Faster os.walk()

Peter Hansen peter at engcorp.com
Wed Apr 20 11:46:34 EDT 2005


Laszlo Zsolt Nagy wrote:
> fuzzylollipop wrote:
> 
>> I am trying to get the number of bytes used by files in a directory.
>> I am using a large directory ( lots of stuff checked out of multiple
>> large cvs repositories ) and there is lots of wasted time doing
>> multiple os.stat() on dirs and files from different methods.
>>  
>>
> Do you need a precise value, or are you satisfied with approximations too?
> Under which operating system? The 'du' command can be your firend.

How can "du" find the sizes without do os.stat() on each
file?



More information about the Python-list mailing list