walking a directory with very many files

Lie Ryan lie.1296 at gmail.com
Fri Jun 19 14:42:49 EDT 2009


Lawrence D'Oliveiro wrote:
> In message <%Zv_l.19493$y61.5958 at news-server.bigpond.net.au>, Lie Ryan 
> wrote:
> 
>> Yeah, it might be possible to just mv the file from outside, but not
>> being able to enter a directory just because you've got too many files
>> in it is kind of silly.
> 
> Sounds like a problem with your file/directory-manipulation tools.
> 

try an `ls` on a folder with 10000+ files.

See how long is needed to print all the files.

Ok, now pipe ls to less, take three days to browse through all the
filenames to locate the file you want to see.

The file manipulation tool may not have problems with it; it's the user
that would have a hard time sorting through the huge amount of files.

Even with glob and grep, some types of queries are just too difficult or
is plain silly to write a full fledged one-time use program just to
locate a few files.



More information about the Python-list mailing list