1 """Constants/functions for interpreting results of os.stat() and os.lstat().
3 Suggested usage: from stat import *
6 # Indices for stat struct members in the tuple returned by os.stat()
19 # Extract bits from the mode
27 # Constants used as S_IFMT() for various file types
28 # (not all are implemented on all systems)
38 # Functions to test for each file type
41 return S_IFMT(mode
) == S_IFDIR
44 return S_IFMT(mode
) == S_IFCHR
47 return S_IFMT(mode
) == S_IFBLK
50 return S_IFMT(mode
) == S_IFREG
53 return S_IFMT(mode
) == S_IFIFO
56 return S_IFMT(mode
) == S_IFLNK
59 return S_IFMT(mode
) == S_IFSOCK
61 # Names for permission bits
83 # Names for file flags
85 UF_NODUMP
= 0x00000001
86 UF_IMMUTABLE
= 0x00000002
87 UF_APPEND
= 0x00000004
88 UF_OPAQUE
= 0x00000008
89 UF_NOUNLINK
= 0x00000010
90 SF_ARCHIVED
= 0x00010000
91 SF_IMMUTABLE
= 0x00020000
92 SF_APPEND
= 0x00040000
93 SF_NOUNLINK
= 0x00100000
94 SF_SNAPSHOT
= 0x00200000