blob: 509936dbca78dd8cbd78232ea3c5c7a21374e721 [file] [log] [blame]
Guido van Rossum2ba9f301992-03-02 16:20:32 +00001#! /usr/local/python
2
3# Find symbolic links and show where they point to.
4# Arguments are directories to search; default is current directory.
5# No recursion.
6# (This is a totally different program from "findsymlinks.py"!)
7
8import sys, posix, path
9
10def lll(dirname):
11 for name in posix.listdir(dirname):
12 if name not in ['.', '..']:
13 full = path.join(dirname, name)
14 if path.islink(full):
15 print name, '->', posix.readlink(full)
16
17args = sys.argv[1:]
18if not args: args = ['.']
19first = 1
20for arg in args:
21 if len(args) > 1:
22 if not first: print
23 first = 0
24 print arg + ':'
25 lll(arg)