[Python-Dev] PEP 471 (scandir): Add a new DirEntry.inode() method? (original) (raw)

Victor Stinner victor.stinner at gmail.com
Sat Feb 14 12:17:11 CET 2015


2015-02-14 11:57 GMT+01:00 Victor Stinner <victor.stinner at gmail.com>:

I propose something else: a DirEntry.inode read-only property (...)

Full DirEntry API:

is_dir(), is_file(), is_symlink() and stat() are method because they may all require a syscall (os.stat or os.lstat). They all cache their result. In some cases, the result is already known when DirEntry is created. In most cases, a single call to os.stat() is required to fill the result of all methods.

Victor



More information about the Python-Dev mailing list