EldoS | Feel safer!

Software components for data protection, secure storage and transfer

FTPS client Question -->delete a directory recursively

Posted: 05/27/2009 12:24:05
by Kunal Gupta (Standard support level)
Joined: 03/31/2008
Posts: 3

I am using a simple FTPS client to FTP files.

Client = new SBSimpleFTPS.TElSimpleFTPSClient();

How do I "easily" delete an entire directory tree which has sub directories and files

The removeDir method will not remove dir or files if there are already files existing and there is no easy way to recursively traverse a directory tree

There is a method in simple SFTP client which will do that task

Client.RemoveFiles(RemoteDirPath + "/", "*.*", false, true);

However the same method does not exist for the Simple FTPS client
Posted: 05/27/2009 12:38:28
by Eugene Mayevski (Team)

Neither FTP nor SFTP have built-in mechanisms to recursively remove directories.

In SFTP client it's possible to obtain the machine-readable file list and to delete all files and subdirecories in code, and this is what we have implemented in RemoveFiles method.

In FTP there's no uniform way to enumerate the files. LIST command returns the human-readable list but parsing of all formats, in which servers return the file lists, is a complicated task which is out of scope of SecureBlackbox functionality. Due to this it's not possible for us to implement RemoveFiles method in the way we did it in SFTP.

Sincerely yours
Eugene Mayevski



Topic viewed 1087 times

Number of guests: 1, registered members: 0, in total hidden: 0


Back to top

As of July 15, 2016 EldoS business operates as a division of /n software, inc. For more information, please read the announcement.

Got it!