Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fast delete folder with more than 30000 images in Android

I have to delete folder with more than 30000 images. I have '.nomedia' file inside to prevent scanning all the time. Trying to delete all files I have to check file name for every file. If I miss this check - '.nomedia' file will be deleted. If this happens before images - this will cause great performance loss. Any idea how to solve this?

UPDATE:

Does anybody know way to hide images from scanning without use '.nomedia'? I can save files with fake extensions, but I'm not sure is this working.

Update:

Actually test shows me this result: Check for name makes deleting about 50% slower. Problem is not in check code but in system scanning folder :(

like image 518
Kostadin Avatar asked Mar 17 '12 07:03

Kostadin


People also ask

What is the fastest way to delete large folders?

Right-click the Shell (folder) key, select New, and click on Key. Name the key Quick Delete and press Enter.

How do I delete a folder with too many files?

Navigate to the folder that you want to delete (with all its files and subfolders). Use cd *path*, for example, cd C:\Trash\Files\ to do so. Use cd .. to navigate to the parent folder and run the command RMDIR /Q/S *foldername* to delete the folder and all of its subfolders.


1 Answers

My solution for moment is:

  1. Rename folder with images.
  2. Create new folder for images with '.nomedia' file inside.
  3. Start background thread to delete old folder.

This way is not faster than previous but allows user to continue work immediately. Of course with one presumption - user have to know about deleting and cleaning occupied space is not finished for a while.

like image 152
Kostadin Avatar answered Sep 24 '22 11:09

Kostadin