Show More
@@ -10,7 +10,9 b' just in case somebody has a strange $TMP' | |||||
10 | $ cd dir |
|
10 | $ cd dir | |
11 |
|
11 | |||
12 | $ cat >printmodes.py <<EOF |
|
12 | $ cat >printmodes.py <<EOF | |
13 | > import os, sys |
|
13 | > from __future__ import absolute_import, print_function | |
|
14 | > import os | |||
|
15 | > import sys | |||
14 | > |
|
16 | > | |
15 | > allnames = [] |
|
17 | > allnames = [] | |
16 | > isdir = {} |
|
18 | > isdir = {} | |
@@ -25,12 +27,13 b' just in case somebody has a strange $TMP' | |||||
25 | > allnames.sort() |
|
27 | > allnames.sort() | |
26 | > for name in allnames: |
|
28 | > for name in allnames: | |
27 | > suffix = name in isdir and '/' or '' |
|
29 | > suffix = name in isdir and '/' or '' | |
28 | > print('%05o %s%s' % (os.lstat(name).st_mode & 07777, name, suffix)) |
|
30 | > print('%05o %s%s' % (os.lstat(name).st_mode & 0o7777, name, suffix)) | |
29 | > EOF |
|
31 | > EOF | |
30 |
|
32 | |||
31 | $ cat >mode.py <<EOF |
|
33 | $ cat >mode.py <<EOF | |
|
34 | > from __future__ import absolute_import, print_function | |||
|
35 | > import os | |||
32 | > import sys |
|
36 | > import sys | |
33 | > import os |
|
|||
34 | > print('%05o' % os.lstat(sys.argv[1]).st_mode) |
|
37 | > print('%05o' % os.lstat(sys.argv[1]).st_mode) | |
35 | > EOF |
|
38 | > EOF | |
36 |
|
39 |
General Comments 0
You need to be logged in to leave comments.
Login now