When I first started to use Matlab for image processing, I used to save off intermediate images so that I wouldn’t have to recompute them for downstream processing. I’ve since changed my approach, and compute everything as I need it, saving nothing but potentially final results.
I had many directories with ten or fifteen thousand small images in them from the days before I stopped writing the intermediate files. The files didn’t take up much space — probably a few GB total — but they took a long time to backup, and made the backup prescan take too long.
I decided to get rid of them.
I opened up an instance of Windows Explorer, navigated to a directory, found the first file and selected it, found the last file, and shift-clicked on it. Then I right-clicked the whole stack, and picked “delete”.
That went fine, even if it did take a while.
I did it a few more times, and got this:
That was strange. I clicked “Skip”, and when the deletions were done, I deleted the offending file — the one that had the temerity to “exist” — with no problem.
Then next time I saw the error, Windows Explorer was so nonplussed as to become unresponsive:
although it was eating up CPU cycles at a prodigious rate:
Lucky for me if couldn’t use more than one node:
I couldn’t do anything with the Retry/Skip window while it was so confused, so I did some research. Apparently, the Recycle bin goes catatonic when faced with too many files to deleted all at once. Wierdly, the shift-rightclick/pick delete move that’s supposed to keep the deleted files from gong into the recycle bin doesn’t keep this from happening. I can verify that.
There are several workarounds. The one that I used successfully, even while Windows Explorer was tied up in computational knots, is to open up a command line window — handy hint: shift/rightclick on the directory you’re interested in and select “Open command window here” — and use “del”, with appropriate wildcards.
Other more-exotic possibilities:
Create a partition, move the files you are finished with to it, and do a quick format.
Temporarily (or permanently if you’re feeling lucky) changing the recycle bin’s properties to “Don’t move files to the Recycle Bin. Remove files immediately when deleted.”
Leave a Reply