A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2015-February/138275.html below:

Add a new DirEntry.inode() method?

[Python-Dev] PEP 471 (scandir): Add a new DirEntry.inode() method? [Python-Dev] PEP 471 (scandir): Add a new DirEntry.inode() method?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:

- name (str) attribute
- path (str) read-only property, created at the first call
- inode (int or None) attribute <=== my proposition
- is_dir(*, follow_symlinks=True)
- is_file(*, follow_symlinks=True)
- is_symlink(*, follow_symlinks=True)
- stat(*, follow_symlinks=True)

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

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4