API Reference

Important

The documentation here defines the module as relic_stat, but the module is actually stat without the appended “relic_”. A conflict with the built-in stat module and the auto-documentation generator requires this modification.

stat

Implementation of the CPython stat library.

  • Author(s): Cooper Dalrymple

Implementation Notes

Software and Dependencies:

relic_stat.ST_ATIME = 7

Time of last access. Symbolic index into the 10-tuple returned by os.stat.

relic_stat.ST_CTIME = 9

The “ctime” as reported by the operating system. On some systems (like Unix) is the time of the last metadata change, and, on others (like Windows), is the creation time (see platform documentation for details). Symbolic index into the 10-tuple returned by os.stat.

relic_stat.ST_DEV = 2

Device inode resides on. Symbolic index into the 10-tuple returned by os.stat.

relic_stat.ST_GID = 5

Group id of the owner. Symbolic index into the 10-tuple returned by os.stat.

relic_stat.ST_INO = 1

Inode number. Symbolic index into the 10-tuple returned by os.stat.

relic_stat.ST_MODE = 0

Inode protection mode. Symbolic index into the 10-tuple returned by os.stat.

relic_stat.ST_MTIME = 8

Time of last modification. Symbolic index into the 10-tuple returned by os.stat.

Number of links to the inode. Symbolic index into the 10-tuple returned by os.stat.

relic_stat.ST_SIZE = 6

Size in bytes of a plain file; amount of data waiting on some special files. Symbolic index into the 10-tuple returned by os.stat.

relic_stat.ST_UID = 4

User id of the owner. Symbolic index into the 10-tuple returned by os.stat.

relic_stat.S_IFBLK = 24576

Block device.

relic_stat.S_IFCHR = 8192

Character device.

relic_stat.S_IFDIR = 16384

Directory.

relic_stat.S_IFDOOR = 0

Door.

relic_stat.S_IFIFO = 4096

FIFO.

relic_stat.S_IFLNK = 40960

Symbolic link.

relic_stat.S_IFMT(mode: int) int

Return the portion of the file’s mode that describes the file type.

relic_stat.S_IFPORT = 0

Event port.

relic_stat.S_IFREG = 32768

Regular file.

relic_stat.S_IFSOCK = 49152

Socket.

relic_stat.S_IFWHT = 0

Whiteout.

relic_stat.S_IMODE(mode: int) int

Return the portion of the file’s mode that can be set by os.chmod.

relic_stat.S_ISBLK(mode: int) bool

Return True if mode is from a block special device file.

relic_stat.S_ISCHR(mode: int) bool

Return True if mode is from a character special device file.

relic_stat.S_ISDIR(mode: int) bool

Return True if mode is from a directory.

relic_stat.S_ISDOOR(mode: int) bool

Return True if mode is from a door.

relic_stat.S_ISFIFO(mode: int) bool

Return True if mode is from a FIFO (named pipe).

relic_stat.S_ISLNK(mode: int) bool

Return True if mode is from a symbolic link.

relic_stat.S_ISPORT(mode: int) bool

Return True if mode is from an event port.

relic_stat.S_ISREG(mode: int) bool

Return True if mode is from a regular file.

relic_stat.S_ISSOCK(mode: int) bool

Return True if mode is from a socket.

relic_stat.S_ISWHT(mode: int) bool

Return True if mode is from a whiteout.

relic_stat.filemode(mode: int) str

Convert a file’s mode to a string of the form ‘-rwxrwxrwx’.

relic_stat.stat(path: str) usage

Like os.stat, but returns a subclass of tuple with named fields.