PEP 471: add the DirEntry.inode() method

Update the PEP according to the implementation.
This commit is contained in:
Victor Stinner 2015-07-29 00:52:34 +02:00
parent 3a6f06fe6e
commit aab4743466
1 changed files with 5 additions and 0 deletions

View File

@ -118,6 +118,11 @@ following attributes and methods:
path) -- the equivalent of ``os.path.join(scandir_path,
entry.name)``
* ``inode()``: return the inode number of the entry. The result is cached on
the ``DirEntry`` object, use ``os.stat(entry.path,
follow_symlinks=False).st_ino`` to fetch up-to-date information.
On Unix, no system call is required.
* ``is_dir(*, follow_symlinks=True)``: similar to
``pathlib.Path.is_dir()``, but the return value is cached on the
``DirEntry`` object; doesn't require a system call in most cases;