summaryrefslogtreecommitdiffstats
path: root/Tools
diff options
context:
space:
mode:
Diffstat (limited to 'Tools')
-rwxr-xr-xTools/scripts/findlinksto.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/Tools/scripts/findlinksto.py b/Tools/scripts/findlinksto.py
index a8051c1..709e4dc 100755
--- a/Tools/scripts/findlinksto.py
+++ b/Tools/scripts/findlinksto.py
@@ -4,26 +4,26 @@
#
# find symbolic links to a given path
-import posix, path, sys
+import os, sys
def visit(pattern, dirname, names):
- if path.islink(dirname):
+ if os.path.islink(dirname):
names[:] = []
return
- if path.ismount(dirname):
+ if os.path.ismount(dirname):
print 'descend into', dirname
n = len(pattern)
for name in names:
- name = path.join(dirname, name)
+ name = os.path.join(dirname, name)
try:
- linkto = posix.readlink(name)
+ linkto = os.readlink(name)
if linkto[:n] == pattern:
print name, '->', linkto
- except posix.error:
+ except os.error:
pass
def main(pattern, args):
for dirname in args:
- path.walk(dirname, visit, pattern)
+ os.path.walk(dirname, visit, pattern)
main(sys.argv[1], sys.argv[2:])