iglob performance no better than glob

Kyp kyp at stsci.edu
Sun Jan 31 19:22:32 EST 2010


On Jan 31, 1:06 pm, John Bokma <j... at castleamber.com> wrote:
> Kyp <k... at stsci.edu> writes:
> > Is there a way to get the first X # of files from a dir with lots of
> > files, that does not take a long time to run?
>
> Assuming Linux: what does time
>
>  ls thedir | head
>
> give?
>
> with thedir the name of the actual dir
about 3 seconds.

3.086u 0.201s 0:03.32 98.7%     0+0k 0+0io 0pf+0w

>
> Also how many is many files?
over 100K (I know I should not do that, but it's a temp dir holding
files to be transferred)
thanx, mark






More information about the Python-list mailing list