Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FTP Protocol and Deleting Directories

Filezilla is taking forever to delete a nested directory structure from my website. Why does it have to change into each sub directory and delete files instead of just removing the whole top most directory in one go? Is removing a file the only supported command in the FTP RFC and does recursive directory removal have to be implemented by the client?

like image 787
getWeberForStackExchange Avatar asked Dec 19 '09 03:12

getWeberForStackExchange


People also ask

How do I delete a folder in FTP?

Description. rmdir( s , folder ) removes the specified folder from the current folder on the SFTP or FTP server associated with s .

Can you delete files from FTP server?

You can delete files several different ways from your server. You can connect with an FTP program like FileZilla and delete files, or you can Use your cPanel File Manager. Below are the steps to delete a file from your server using File Manager and FTP.

Which function is used for removing directory?

Use the rmdir command to remove the directory, specified by the Directory parameter, from the system. The directory must be empty (it can contain only .

How do I delete my FTP data?

If you're using the Windows command-line ftp client, then you will need to use mdelete to delete multiple files, as delete will only delete a single file. Edit: Answering the additional questions in the comments. Then you could run this as a single step with the -s parameter.


2 Answers

The FTP RFC (or the Extensions to FTP RFC) does not define any command to recursively delete a directory. You only have the DELE command, defined in section 4.1.3 to delete a file and the way to delete an entire tree using FTP is to recursively delete files and folders (RMD), one by one.

like image 79
Gonzalo Avatar answered Nov 06 '22 15:11

Gonzalo


Well, unfortunately yes, as per RFC 959 and a more friendly list

like image 34
Kornel Kisielewicz Avatar answered Nov 06 '22 15:11

Kornel Kisielewicz