[Python-ideas] Speed up os.walk() 5x to 9x by using file attributes from FindFirst/NextFile() and readdir()

Ben Hoyt benhoyt at gmail.com
Tue Nov 13 08:13:23 CET 2012

> Where would st_mode be retrieved from?  The readdir(3) interface
> only provides d_type (and that field is not in POSIX or SUS).
> The d_type field contains a file type, and while you could use that
> to construct a value for st_mode that can be used to test the file
> type, you cannot reconstruct the file permissions from that.

Yes, you're right. The amount of information in st_mode would be
implementation dependent. I don't see a huge problem with that -- it's
already true for os.stat(), because on Windows stat()'s st_mode
contains a much more limited subset of info than on POSIX systems.


More information about the Python-ideas mailing list