summaryrefslogtreecommitdiffstats
path: root/Lib/stat.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/stat.py')
-rw-r--r--Lib/stat.py54
1 files changed, 27 insertions, 27 deletions
diff --git a/Lib/stat.py b/Lib/stat.py
index 5f41687..c054fb8 100644
--- a/Lib/stat.py
+++ b/Lib/stat.py
@@ -24,21 +24,21 @@ ST_CTIME = 9
# Extract bits from the mode
def S_IMODE(mode):
- return mode & 07777
+ return mode & 0o7777
def S_IFMT(mode):
- return mode & 0170000
+ return mode & 0o170000
# Constants used as S_IFMT() for various file types
# (not all are implemented on all systems)
-S_IFDIR = 0040000
-S_IFCHR = 0020000
-S_IFBLK = 0060000
-S_IFREG = 0100000
-S_IFIFO = 0010000
-S_IFLNK = 0120000
-S_IFSOCK = 0140000
+S_IFDIR = 0o040000
+S_IFCHR = 0o020000
+S_IFBLK = 0o060000
+S_IFREG = 0o100000
+S_IFIFO = 0o010000
+S_IFLNK = 0o120000
+S_IFSOCK = 0o140000
# Functions to test for each file type
@@ -65,25 +65,25 @@ def S_ISSOCK(mode):
# Names for permission bits
-S_ISUID = 04000
-S_ISGID = 02000
+S_ISUID = 0o4000
+S_ISGID = 0o2000
S_ENFMT = S_ISGID
-S_ISVTX = 01000
-S_IREAD = 00400
-S_IWRITE = 00200
-S_IEXEC = 00100
-S_IRWXU = 00700
-S_IRUSR = 00400
-S_IWUSR = 00200
-S_IXUSR = 00100
-S_IRWXG = 00070
-S_IRGRP = 00040
-S_IWGRP = 00020
-S_IXGRP = 00010
-S_IRWXO = 00007
-S_IROTH = 00004
-S_IWOTH = 00002
-S_IXOTH = 00001
+S_ISVTX = 0o1000
+S_IREAD = 0o0400
+S_IWRITE = 0o0200
+S_IEXEC = 0o0100
+S_IRWXU = 0o0700
+S_IRUSR = 0o0400
+S_IWUSR = 0o0200
+S_IXUSR = 0o0100
+S_IRWXG = 0o0070
+S_IRGRP = 0o0040
+S_IWGRP = 0o0020
+S_IXGRP = 0o0010
+S_IRWXO = 0o0007
+S_IROTH = 0o0004
+S_IWOTH = 0o0002
+S_IXOTH = 0o0001
# Names for file flags