Count Files in a Directory

Jay Dorsey jay at jaydorsey.com
Mon Dec 22 13:17:31 EST 2003


On Mon, Dec 22, 2003 at 12:41:03PM -0500, hokieghal99 wrote:
> Woops... I spoke too soon. Just caught this difference on 4.4GB of data. 
>    The os thinks there are 12,204 objects in the path while Python 
> thinks there are 12,205 objects.

What command are you using to find out how many objects are in the path?

Also, what order to you run the commands in--maybe there *are* 12,205 objects
in the path when you run the Python script.  Maybe a tmp file is being created, 
or processes are occuring that add and remove files on the system. 

If you could check a non-system path (one where the OS wont' read/write to) with 
large amounts of data that would probably be best.  What OS is this, and whats 
the path that you pass in to your function?

-- 
Jay Dorsey
jay at jaydorsey dot com





More information about the Python-list mailing list