Max files in unix folder from PIL process

Andrew Dalke dalke at dalkescientific.com
Tue Mar 29 04:33:56 CEST 2005


Kane wrote:
> I ran into a similar situation with a massive directory of PIL
> generated images (around 10k).  No problems on the filesystem/Python
> side of things but other tools (most noteably 'ls') don't cope very
> well.

My experience suggests that 'ls' has a lousy sort routine or
that it takes a long time to get the metadata.

When I've had to deal with a huge number of files in a directory
I can get the list very quickly in Python using os.listdir
even though ls is slow.  If you're in that situation again, see
if the '-f' for unsorted flag makes a difference or use '-1'
to see if it's all the stat calls.

				Andrew
				dalke at dalkescientific.com




More information about the Python-list mailing list