[Python-Dev] My summary of the scandir (PEP 471) (original) (raw)

Nikolaus Rath Nikolaus at rath.org
Wed Jul 2 23:59:01 CEST 2014


Ben Hoyt <benhoyt at gmail.com> writes:

Thanks for the clarifications and support.

Ah, the wording in the PEP says "Linux, Windows, OS X". Superficially, that said "everywhere" to me. It might be worth calling out specifically some examples where it's not available without an extra system call, just to make the point explicit. Good call. I'll update the wording in the PEP here and try to call out specific examples of where isdir() could call os.stat(). Hard-core POSIX people, do you know when readdir() dtype will be DTUNKNOWN on (for example) Linux or OS X? I suspect this can happen on certain network filesystems, but I'm not sure.

Any fuse file system mounted by some other user and without -o allow_other. For these entries, stat() will fail as well.

Best, -Nikolaus

-- GPG encrypted emails preferred. Key id: 0xD113FCAC3C4E599F Fingerprint: ED31 791B 2C5C 1613 AF38 8B8A D113 FCAC 3C4E 599F

         »Time flies like an arrow, fruit flies like a Banana.«


More information about the Python-Dev mailing list