PyDocs

Nav

Generic Operating System Services

DirEntry

os

class · Added in 3.5
Object yielded by scandir() to expose the file path and other file attributes of a directory entry.
Changed in 3.6, 3.12
  • 3.6: Added support for the PathLike interface. Added support for bytes paths on Windows.
  • 3.12: The st_ctime attribute of a stat result is deprecated on Windows. The file creation time is properly available as st_birthtime, and in the future st_ctime may be changed to return zero or the metadata change time, if available.
Members of DirEntry

i

inode
Return inode of the entry; cached per entry.
is_dir
Return True if the entry is a directory; cached per entry.
is_file
Return True if the entry is a file; cached per entry.
is_junction
Return True if the entry is a junction; cached per entry.
is_symlink
Return True if the entry is a symbolic link; cached per entry.

n

name
the entry's base filename, relative to scandir() "path" argument

p

path
the entry's full path name; equivalent to os.path.join(scandir_path, entry.name)

s

stat
Return stat_result object for the entry; cached per entry.
0 Examples
No examples for os/DirEntry.
See Also
No see-alsos for os/DirEntry
0 Notes
No notes for DirEntry