Message257657
> 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 |
|
Date |
User |
Action |
Args |
2016-01-06 23:03:57 | vstinner | set | recipients:
+ vstinner, gvanrossum, pitrou, benhoyt, ethan.furman, serhiy.storchaka |
2016-01-06 23:03:57 | vstinner | set | messageid: <1452121437.47.0.436078655626.issue26032@psf.upfronthosting.co.za> |
2016-01-06 23:03:57 | vstinner | link | issue26032 messages |
2016-01-06 23:03:57 | vstinner | create | |
|