RemoveDirectory - SFTP server error occurred: Failure

Discussion of open issues, suggestions and bugs regarding network security and data protection solution - SecureBridge
Post Reply
multimesut
Posts: 18
Joined: Mon 28 Nov 2011 18:04
Location: Türkiye

RemoveDirectory - SFTP server error occurred: Failure

Post by multimesut » Mon 04 Dec 2017 12:59

Hi,

I cannot delete a folder full of file and folder. What should I do?

Command;
oSFTPClient.RemoveDirectory('/etc/test');

Error;
Project Project1.exe raised exception class EScSFTPError with message 'SFTP server error occurred: Failure'.

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: RemoveDirectory - SFTP server error occurred: Failure

Post by ViktorV » Thu 07 Dec 2017 10:07

Most likely your SFTP server does not allow removing an empty directory. Then, to solve the issue, you should clear the directory before calling the RemoveDirectory method.

multimesut
Posts: 18
Joined: Mon 28 Nov 2011 18:04
Location: Türkiye

Re: RemoveDirectory - SFTP server error occurred: Failure

Post by multimesut » Thu 07 Dec 2017 17:44

I can not delete the full folder via winscp and I do not get any errors. but I get this error when I delete the full folder with the command RemoveDirectory in SecureBridge component. I delete everything in the folder but it deletes the empty folder. I need you to have a code like the one below.

RemoveDirectory(folder:string;allfiles:boolean)

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: RemoveDirectory - SFTP server error occurred: Failure

Post by ViktorV » Fri 08 Dec 2017 12:36

The TScSFTPClient component executes SFTP protocol commands and generates an error if the server returns an error when executing a command. This is correct behavior of our component. To solve the task, you should implement this functionality by yourself.

Post Reply