Don't ask to ask, just ask | |
PerlMonks |
Finding and sorting files in massive file directoryby CColin (Scribe) |
on Jan 20, 2013 at 19:10 UTC ( [id://1014320]=perlquestion: print w/replies, xml ) | Need Help?? |
CColin has asked for the wisdom of the Perl Monks concerning the following question:
Hi,
I have a directory with c. 2-3 million files (and growing) that I need to categorise and compress.
Categorise might be by prefix, eg. all files beginning with a, b, c and so on. Compress would then be eg. compress/ archive all files beginning with b. I'd probably then want to delete all files beginning with b* once archived I can think of using Find::File::Rule to walk through the directory and group files by type, but am concerned about how to properly handle a directory of files on this size and the correct way to compress them as I go, and then delete them once compressed. At the moment, shell commands on the directory - find, ls etc - just hang! Thanks
Back to
Seekers of Perl Wisdom
|
|