STINNER Victor added the comment:

> As I recall, if the platform's DirEntry doesn't provide the cacheable 
> attributes when first called, those attributes will be looked up (and cached) 
> on first access.

scandir() is not magic. It simply provides info given by the OS: see readdir() 
on UNIX and FindFirstFile()/FindNextFile() on Windows.

DirEntry calls os.stat() if needed, but it caches the result.

DirEntry doc tries to explain when syscalls or required or not, depending on 
the requested information and the platform:
https://docs.python.org/dev/library/os.html#os.DirEntry

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue26032>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to