"""Constants/functions for interpreting results of os.stat() and os.lstat().
Suggested usage: from stat import *
# Indices for stat struct members in the tuple returned by os.stat()
# Extract bits from the mode
# Constants used as S_IFMT() for various file types
# (not all are implemented on all systems)
# Functions to test for each file type
return S_IFMT(mode) == S_IFDIR
return S_IFMT(mode) == S_IFCHR
return S_IFMT(mode) == S_IFBLK
return S_IFMT(mode) == S_IFREG
return S_IFMT(mode) == S_IFIFO
return S_IFMT(mode) == S_IFLNK
return S_IFMT(mode) == S_IFSOCK
# Names for permission bits
UF_IMMUTABLE = 0x00000002
UF_COMPRESSED = 0x00000020 # OS X: file is hfs-compressed
UF_HIDDEN = 0x00008000 # OS X: file should not be displayed
SF_IMMUTABLE = 0x00020000