Page 1 of 1

Stop Directory looping/scrolling

Posted: 2012-03-18 00:48
by amommy
Hi
I have been using FileZilla for quite some time and this has ALWAYS bugged me and cannot stop it.
How do I stop it from looping (or whatever you call it) through a directory when I delete it?
How do I go to ANOTHER directory while it is deleting?
I used to be able to do that with another program, ages ago don't remember which one.

Re: Stop Directory looping/scrolling

Posted: 2012-03-18 00:59
by boco
When deleting (and adding to queue, too, for that matter) many FTP servers do not allow deleting non-empty directories. Thus FileZilla has to walk the directory tree and delete all files and subdirectories first. Since that's done using the browsing connection, you cannot do anything else while it's running. I admin the solution is not optimal, but the developer surely has a reason for implementation that eludes me...

Re: Stop Directory looping/scrolling

Posted: 2012-03-18 08:19
by botg
Complexity. Using the browsing connection for this task is already extremely complex. Moving it into a separate connection would be even more complex.

Re: Stop Directory looping/scrolling

Posted: 2012-03-18 22:19
by boco
@botg: Would it be possible, if the user selects to delete a complete tree, to first try to remove the dir as-is? If the server supports it (mine does), that succeeds and you just saved a lot of time. If it errors, just execute the wash-rinse-repeat cycle through the tree.

Re: Stop Directory looping/scrolling

Posted: 2012-03-19 07:08
by botg
It supports this without requiring additional parameters to the RMD command?

Re: Stop Directory looping/scrolling

Posted: 2012-03-19 15:22
by boco
botg wrote:It supports this without requiring additional parameters to the RMD command?
Yes, only the pathname must be given.

Code: Select all

2012-03-19 16:19:52 - sysop-1 (10.0.0.1) > XRMD non_empty_directory
2012-03-19 16:19:52 - sysop-1 (10.0.0.1) < 250 Requested file action okay, completed.
Note the XRMD vs RMD is because I used the Windows ftp.exe for the test. The directory had subdirectories and files inside.

Re: Stop Directory looping/scrolling

Posted: 2012-03-19 20:24
by botg
Might be worth a try.

Re: Stop Directory looping/scrolling

Posted: 2012-03-26 04:01
by panamade
Did you try?
My IP camera uploaded erroneously around 250,000 files and the ftp process of deleting them one by one is interrupted often by connection errors, so I would need to be present for a few days to restart the deletion loop each time it stops.

Re: Stop Directory looping/scrolling

Posted: 2012-03-26 05:29
by boco
There hasn't been a new release since his post. I looked up the changelog and this doesn't seem to have been implemented, yet. Also, if your server doesn't support deleting non-empty directories, the change wouldn't affect you, anyway.

Re: Stop Directory looping/scrolling

Posted: 2012-03-26 08:12
by tateu
Is there any reason for an ftp server not to use a recursive delete function internally and to instead rely on the client to handle it? I modified vsftpd v2.3.5 and made it handle an RMD command as recursive and put it on my test server. In my very limited testing it seems to be working fine.

I guess that if recursive delete is not part of the FTP spec, there is no way for a client to know whether or not the server handles it. In my recursive tests with vsftpd, I have only tried entering the RMD command via the custom command menu so FileZilla didn't also try a recursive delete. It seems like there could be some problems if both the client and server do a recursive delete.

Re: Stop Directory looping/scrolling

Posted: 2012-03-26 08:44
by boco
That's what happens if there's no strict rule about a feature. Both behaviors are allowed, and both must be taken care of. FileZilla so far uses the conservative approach and navigates through the subdirectories, deleting all files and the subdirectories itself.
I guess that if recursive delete is not part of the FTP spec, there is no way for a client to know whether or not the server handles it. In my recursive tests with vsftpd, I have only tried entering the RMD command via the custom command menu so FileZilla didn't also try a recursive delete. It seems like there could be some problems if both the client and server do a recursive delete.
I don't think so. After the proposed modification gets implemented, FileZilla will just try to RMD the non-empty directory first. If the server handles that, it will return success and FileZilla can move on. If the server doesn't support it, there will be an error returned. FileZilla will then fall back to the current behavior.

Re: Stop Directory looping/scrolling

Posted: 2012-03-26 14:00
by panamade
I am not a very deeply informed specialist about ftp, so I may not have understood everything correctly.
I understand there is a RMD command that some servers but not all accept.
I imagine that this command means "remove directory" and that in order to find out if it works with a specific server one should simply try it.

How can I enter these commands with filezilla? I installed it only yesterday and find that it works a lot better than my previous WS-FTP. But the high level commands that I can give (like "delete" are obviously not exactly what the server receives, which is comfortable on one hand, but does not seem to allow to enter low-level commands.
What should I do to enter a RMD command? Mark the folder and then what ?

Re: Stop Directory looping/scrolling

Posted: 2012-03-27 03:15
by boco
I understand there is a RMD command that some servers but not all accept.
The RMD command is accepted by all FTP servers. The problem is that some of them refuse to remove a directory which is not completely empty.
What should I do to enter a RMD command? Mark the folder and then what ?
Usually you mark, right-click, Delete. Currently, FileZilla then starts the known procedure we are currently discussing here.
But the high level commands that I can give (like "delete" are obviously not exactly what the server receives, which is comfortable on one hand, but does not seem to allow to enter low-level commands.
The raw communication with the server (commands sent and responses received) can be seen in the log pane. In fact, that's the purpose of the log.
How can I enter these commands with filezilla?
To send a raw command to the server, use the ''Enter custom command...'' feature in the Server menu. You must type everything manually, including all parameters like the directory name. FileZilla will then send that string to the server without any modification. You will see the server response in the log.

Example:
1. You have a non-empty directory you'd like to delete. You want to test if that server supports direct removing of non-empty directories.
2. Use the ''Enter custom command...'' and enter RMD <name of the directory>. Press OK to send.
3. Now two things could happen:
a. The server refuses and returns a 5xx error. Some print an informative text like ''Cannot remove non-empty directory'' or ''Directory not empty''. In this case, the proposed change in this thread will not affect you and FileZilla has to process the long process this is all about.
b. The server accepts and the directory is removed instantly. Note the file and directory panes in FileZilla are not updated after a raw command, you must press F5 to refresh. You will be able to remove directories much faster in the future when this gets implemented.

Re: Stop Directory looping/scrolling

Posted: 2012-03-28 14:41
by panamade
Hi, just to let you know I resolved my particular problem via the provider of the server. They have an online file manager with which I was able to kill the entire folder instead of first deleting 250,000 files.
I had to send the command about ten times but eventually the folder was killed. Of course this does not resolve the question how filezilla can do that.