Removing a directory which contains a lot of files

Support for Android version of Total Commander

Moderators: white, Hacker, petermad, Stefan2

Post Reply
Scoulder
Junior Member
Junior Member
Posts: 21
Joined: 2013-09-27, 07:51 UTC
Location: Germany

Removing a directory which contains a lot of files

Post by *Scoulder »

I just had to delete a folder with thousands of files in it.
First it took Total Commander a lot of time to pre-check all the files to delete and after that the deletion process itself took even longer.

Just wondering: wouldn't it be better (faster) to just invoke a command (rm?) that removes the complete folder regardless of the files it contains instead of deleting each single file separately?
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48232
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

I don't know whether this would be any faster - flash memory in most Android devices is quite slow. TC counts the files so it can show a delete progress to the user. Normally counting should be much faster than deleting. But it's possible that TC also checks the individual entries (to get file sizes), which would be necessary only when copying.

Btw, you can do this via a user-defined button if you need it. I recommend that you put a '?' as the first parameter to get a confirmation dialog.
Author of Total Commander
https://www.ghisler.com
Scoulder
Junior Member
Junior Member
Posts: 21
Joined: 2013-09-27, 07:51 UTC
Location: Germany

Post by *Scoulder »

Ok, thanks for the quick reply.

I probably didn't fully understand how the file system works. I assumed a delete would just tell the OS that the specified memory slot is no more needed and if it's done for the whole folder instead of for all files separately it would be done in a blink of an eye.

And thanks for the hint with the user-defined buttons, I'll definitely take a deeper look into this.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48232
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

No, unfortunately not - you have to tell the system to delete each file separately.
Author of Total Commander
https://www.ghisler.com
Post Reply