Show More
@@ -94,9 +94,11 b' Portable way to print file permissions:' | |||
|
94 | 94 | |
|
95 | 95 | $ cat > ls-l.py <<EOF |
|
96 | 96 | > #!$PYTHON |
|
97 | > import sys, os | |
|
97 | > from __future__ import absolute_import, print_function | |
|
98 | > import os | |
|
99 | > import sys | |
|
98 | 100 | > path = sys.argv[1] |
|
99 | > print('%03o' % (os.lstat(path).st_mode & 0777)) | |
|
101 | > print('%03o' % (os.lstat(path).st_mode & 0o777)) | |
|
100 | 102 | > EOF |
|
101 | 103 | $ chmod +x ls-l.py |
|
102 | 104 |
General Comments 0
You need to be logged in to leave comments.
Login now