PyDocs

File and Directory Access

stat

Constants/functions for interpreting results of os.stat() and os.lstat().

Suggested usage: from stat import *
Symbols in stat

f

FILE_ATTRIBUTE_ARCHIVE
Added in version 3.5.
FILE_ATTRIBUTE_COMPRESSED
Added in version 3.5.
FILE_ATTRIBUTE_DEVICE
Added in version 3.5.
FILE_ATTRIBUTE_DIRECTORY
Added in version 3.5.
FILE_ATTRIBUTE_ENCRYPTED
Added in version 3.5.
FILE_ATTRIBUTE_HIDDEN
Added in version 3.5.
FILE_ATTRIBUTE_INTEGRITY_STREAM
Added in version 3.5.
FILE_ATTRIBUTE_NO_SCRUB_DATA
Added in version 3.5.
FILE_ATTRIBUTE_NORMAL
Added in version 3.5.
FILE_ATTRIBUTE_OFFLINE
Added in version 3.5.
FILE_ATTRIBUTE_READONLY
Added in version 3.5.
FILE_ATTRIBUTE_REPARSE_POINT
Added in version 3.5.
FILE_ATTRIBUTE_SPARSE_FILE
Added in version 3.5.
FILE_ATTRIBUTE_SYSTEM
Added in version 3.5.
FILE_ATTRIBUTE_TEMPORARY
Added in version 3.5.
FILE_ATTRIBUTE_VIRTUAL
Added in version 3.5.
filemode
Convert a file's mode to a string of the form '-rwxrwxrwx'

i

IO_REPARSE_TAG_APPEXECLINK
Added in version 3.8.
IO_REPARSE_TAG_MOUNT_POINT
Added in version 3.8.
IO_REPARSE_TAG_SYMLINK
Added in version 3.8.

s

S_ENFMT
System V file locking enforcement.
S_IEXEC
Unix V7 synonym for S_IXUSR.
S_IFBLK
Block device.
S_IFCHR
Character device.
S_IFDIR
Directory.
S_IFIFO
FIFO.
S_IFLNK
Symbolic link.
S_IFMT
Return the portion of the file's mode that describes the file type.
S_IFPORT
Event port.
S_IFREG
Regular file.
S_IFSOCK
Socket.
S_IFWHT
Whiteout.
S_IMODE
Return the portion of the file's mode that can be set by os.chmod().
S_IREAD
Unix V7 synonym for S_IRUSR.
S_IRGRP
Group has read permission.
S_IROTH
Others have read permission.
S_IRUSR
Owner has read permission.
S_IRWXG
Mask for group permissions.
S_IRWXO
Mask for permissions for others (not in group).
S_IRWXU
Mask for file owner permissions.
S_ISBLK
Return True if mode is from a block special device file.
S_ISCHR
Return True if mode is from a character special device file.
S_ISDIR
Return True if mode is from a directory.
S_ISDOOR
Return True if mode is from a door.
S_ISFIFO
Return True if mode is from a FIFO (named pipe).
S_ISGID
Set-group-ID bit.
S_ISLNK
Return True if mode is from a symbolic link.
S_ISPORT
Return True if mode is from an event port.
S_ISREG
Return True if mode is from a regular file.
S_ISSOCK
Return True if mode is from a socket.
S_ISUID
Set UID bit.
S_ISVTX
Sticky bit.
S_ISWHT
Return True if mode is from a whiteout.
S_IWGRP
Group has write permission.
S_IWOTH
Others have write permission.
S_IWRITE
Unix V7 synonym for S_IWUSR.
S_IWUSR
Owner has write permission.
S_IXGRP
Group has execute permission.
S_IXOTH
Others have execute permission.
S_IXUSR
Owner has execute permission.
SF_APPEND
The file may only be appended to.
SF_ARCHIVED
The file may be archived.
SF_DATALESS
The file is a dataless object (macOS 10.15+)
SF_FIRMLINK
The file is a firmlink (macOS 10.15+)
SF_IMMUTABLE
The file may not be changed.
SF_NOUNLINK
The file may not be renamed or deleted.
SF_RESTRICTED
The file needs an entitlement to write to (macOS 10.13+)
SF_SETTABLE
All super-user changeable flags
SF_SNAPSHOT
The file is a snapshot file.
SF_SUPPORTED
All super-user supported flags
SF_SYNTHETIC
All super-user read-only synthetic flags
ST_ATIME
Time of last access.
ST_CTIME
The “ctime” as reported by the operating system.
ST_DEV
Device inode resides on.
ST_GID
Group id of the owner.
ST_INO
Inode number.
ST_MODE
Inode protection mode.
ST_MTIME
Time of last modification.
ST_NLINK
Number of links to the inode.
ST_SIZE
Size in bytes of a plain file; amount of data waiting on some special files.
ST_UID
User id of the owner.
STATX_ATTR_APPEND
Added in version 3.15.
STATX_ATTR_AUTOMOUNT
Added in version 3.15.
STATX_ATTR_COMPRESSED
Added in version 3.15.
STATX_ATTR_DAX
Added in version 3.15.
STATX_ATTR_ENCRYPTED
Added in version 3.15.
STATX_ATTR_IMMUTABLE
Added in version 3.15.
STATX_ATTR_MOUNT_ROOT
Added in version 3.15.
STATX_ATTR_NODUMP
Added in version 3.15.
STATX_ATTR_VERITY
Added in version 3.15.
STATX_ATTR_WRITE_ATOMIC
Added in version 3.15.

u

UF_APPEND
The file may only be appended to.
UF_COMPRESSED
The file is stored compressed (macOS 10.6+).
UF_DATAVAULT
The file needs an entitlement for reading or writing (macOS 10.13+)
UF_HIDDEN
The file should not be displayed in a GUI (macOS 10.5+).
UF_IMMUTABLE
The file may not be changed.
UF_NODUMP
Do not dump the file.
UF_NOUNLINK
The file may not be renamed or deleted.
UF_OPAQUE
The directory is opaque when viewed through a union stack.
UF_SETTABLE
All user settable flags.
UF_TRACKED
Used for handling document IDs (macOS)