TScSFTPClient rename flags not working

Discussion of open issues, suggestions and bugs regarding network security and data protection solution - SecureBridge
Post Reply
RobinP
Posts: 7
Joined: Mon 08 Jun 2020 12:16

TScSFTPClient rename flags not working

Post by RobinP » Fri 24 Jun 2022 10:36

Hi, I'm using the TScSFTPClient component with C++ Builder. The rename operation fails if the target file already exists even if I pass the rfOverwrite flag. My code is below, am I missing something? Thx.

Code: Select all

        if (!ScSFTPClient->Active)
            ScSFTPClient->Initialize();
        TScSFTPRenameFlags flags;
        if (overwrite)
            flags << rfOverwrite;
        else
            flags >> rfOverwrite;
        ScSFTPClient->RenameFile(src_path, dst_path, flags);

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Re: TScSFTPClient rename flags not working

Post by Dimon » Thu 30 Jun 2022 10:10

Hi there,

Please provide us with the exact error message you are getting. There is a chance that this behavior is related to SFTP server settings. Please check if it is possible to perform this operation using any third-party tools (e.g. Putty).

RobinP
Posts: 7
Joined: Mon 08 Jun 2020 12:16

Re: TScSFTPClient rename flags not working

Post by RobinP » Thu 30 Jun 2022 12:21

Hi, thanks for your answer looks like you may be right, I tried with FileZilla and even though it prompted me to overwrite the rename failed.
The error message I get is just code 4 "Failure".

I've worked around it for now by always deleting the destination file first.

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Re: TScSFTPClient rename flags not working

Post by Dimon » Wed 06 Jul 2022 08:17

If there is anything else I can help you with, please contact me.

Post Reply