3 # Defines constants and functions for interpreting stat/lstat struct
4 # as returned by os.stat() and os.lstat() (if it exists).
6 # Suggested usage: from stat import *
8 # XXX Strictly spoken, this module may have to be adapted for each POSIX
9 # implementation; in practice, however, the numeric constants used by
10 # stat() are almost universal (even for stat() emulations on non-UNIX
11 # systems like MS-DOS).
13 # Indices for stat struct members in tuple returned by os.stat()
26 # Extract bits from the mode
34 # Constants used as S_IFMT() for various file types
35 # (not all are implemented on all systems)
40 # Functions to test for each file type
43 return S_IFMT(mode
) == S_IFDIR
52 return S_IFMT(mode
) == S_IFREG
63 # Names for permission bits