os.listdir unwanted behaviour

Hendrik van Rooyen hendrik at microcorp.co.za
Tue Sep 29 16:20:59 CEST 2009


On Tuesday, 29 September 2009 11:03:17 Tim Chase wrote:

> I think Steven may be remembering the conversation here on c.l.p
> a month or two back where folks were asking to turn os.listdir()
> into an iterator (or create an os.xlistdir() or os.iterdir()
> function) because directories with lots of files were causing
> inordinate slowdown.  Yes, listdir() in both 2.x and 3.x both
> return lists while such a proposed iterator version could be
> changed on the fly by interim file/directory creation.

Is os.walk not the right thing to use for this kind of stuff?

- Hendrik




More information about the Python-list mailing list