PyDocs

Nav

Generic Operating System Services

stat_result

os

class
  • stat_result(iterable=(), /)
stat_result: Result from stat, fstat, or lstat.

This object may be accessed either as a tuple of
  (mode, ino, dev, nlink, uid, gid, size, atime, mtime, ctime)
or via the attributes st_mode, st_ino, st_dev, st_nlink, and so on.

Posix/windows: If your platform supports st_blksize, st_blocks, st_rdev,
or st_flags, they are available as attributes only.

See os.stat for more information.
Changed in 3.5, 3.7, 3.8, 3.12
  • 3.5: Windows now returns the file index as st_ino when available.
  • 3.7: Added the st_fstype member to Solaris/derivatives.
  • 3.8: Added the st_reparse_tag member on Windows.
  • 3.8: On Windows, the st_mode member now identifies special files as S_IFCHR, S_IFIFO or S_IFBLK as appropriate.
  • 3.12: On Windows, st_ctime is deprecated. Eventually, it will contain the last metadata change time, for consistency with other platforms, but for now still contains creation time. Use st_birthtime for the creation time. On Windows, st_ino may now be up to 128 bits, depending on the file system. Previously it would not be above 64 bits, and larger file identifiers would be arbitrarily packed. On Windows, st_rdev no longer returns a value. Previously it would contain the same as st_dev, which was incorrect. Added the st_birthtime member on Windows.
Members of stat_result

s

st_atime
time of last access
st_atime_ns
time of last access in nanoseconds
st_birthtime
Time of file creation expressed in seconds.
st_birthtime_ns
Time of file creation expressed in nanoseconds as an integer.
st_blksize
blocksize for filesystem I/O
st_blocks
number of blocks allocated
st_creator
Creator of the file.
st_ctime
time of last change
st_ctime_ns
time of last change in nanoseconds
st_dev
device
st_file_attributes
Windows file attributes: dwFileAttributes member of the BY_HANDLE_FILE_INFORMATION structure returned by GetFileInformationByHandle().
st_flags
User defined flags for file.
st_fstype
String that uniquely identifies the type of the filesystem that contains the file.
st_gen
File generation number.
st_gid
group ID of owner
st_ino
inode
st_mode
protection bits
st_mtime
time of last modification
st_mtime_ns
time of last modification in nanoseconds
st_nlink
number of hard links
st_rdev
device type (if inode device)
st_reparse_tag
When st_file_attributes has the FILE_ATTRIBUTE_REPARSE_POINT set, this field contains the tag identifying the type of reparse point.
st_rsize
Real size of the file.
st_size
total size, in bytes
st_type
File type.
st_uid
user ID of owner
0 Examples
No examples for os/stat_result.
See Also
No see-alsos for os/stat_result
0 Notes
No notes for stat_result