Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
d972721b
Commit
d972721b
authored
May 06, 1992
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add names for perm bits (S_IREAD etc).
Only extract 4 bits of mode to get the file type
parent
89e418e0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
1 deletion
+23
-1
Lib/stat.py
Lib/stat.py
+23
-1
No files found.
Lib/stat.py
View file @
d972721b
...
...
@@ -29,7 +29,7 @@ def S_IMODE(mode):
return
mode
&
07777
def
S_IFMT
(
mode
):
return
mode
&
~
07777
return
mode
&
0170000
# Constants used as S_IFMT() for various file types
# (not all are implemented on all systems)
...
...
@@ -64,3 +64,25 @@ def S_ISLNK(mode):
def
S_ISSOCK
(
mode
):
return
S_IFMT
(
mode
)
==
S_IFSOCK
# Names for permission bits
S_ISUID
=
04000
S_ISGID
=
02000
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment