2015-02-14 11:57 GMT+01:00 Victor Stinner <victor.stin...@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
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to