Comment 5 for bug 172861

Revision history for this message
Robert Collins (lifeless) wrote : Re: [Bug 172861] Re: add: accepts aliases due to case insensitivity

On Thu, 2007-11-29 at 19:11 +0000, Alexander Belchenko wrote:
>
> Looking at internal realization of os.listdir in CPython I'm sure one
> day we should
> rewrite win32 walkdirs code and throw away os.listdir *completely*.
> Because:
> 1) os.listdir use FindFiles API internally
> 2) WIN32_FIND_DATA contains *all* stat info, so additional os.lstat in
> walkdirs code
> is simply redundant! On win32 we are able produce os.listdir and
> os.lstat for each
> item in os.listdir output in one pass! If you're remember additional
> os.lstat costs
> too much on FAT32 as I discover with my fake symlinks code.
> 3) IMO walkdirs generator on win32 should emit pair of filenames: real
> name on disk
> and normalized name (lowercased for win32). Again we will be able to
> produce it
> in one pass and therefore get performance win.

+1 from me - os.listdirs is not a good interface on unix either. Many
fs's can give us file kind directly; saving us from statting directories
and symlinks.

-Rob
--
GPG key available at: <http://www.robertcollins.net/keys.txt>.