[issue11583] os.path.isdir() is slow on windows

Martin v. Löwis report at bugs.python.org
Thu Mar 17 15:44:06 CET 2011


Martin v. Löwis <martin at v.loewis.de> added the comment:

Ok. It's probably not the most optimal thing we can do. It opens the directory with CreateFileW (specifying OPEN_EXISTING and BACKUP_SEMANTICS), then GetFileInformationByHandle. If we only want to find out whether the file is a directory, we could just to FindFirstFile, which wouldn't need to go to the MFT record.

I would be surprised if this makes a difference in practice, though.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue11583>
_______________________________________


More information about the Python-bugs-list mailing list