- Notifications
You must be signed in to change notification settings - Fork 31.8k
/
Copy pathlll.py
executable file
·27 lines (23 loc) · 743 Bytes
/
lll.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#! /usr/bin/env python
# Find symbolic links and show where they point to.
# Arguments are directories to search; default is current directory.
# No recursion.
# (This is a totally different program from "findsymlinks.py"!)
importsys, os
deflll(dirname):
fornameinos.listdir(dirname):
ifnamenotin (os.curdir, os.pardir):
full=os.path.join(dirname, name)
ifos.path.islink(full):
printname, '->', os.readlink(full)
defmain(args):
ifnotargs: args= [os.curdir]
first=1
forarginargs:
iflen(args) >1:
ifnotfirst: print
first=0
printarg+':'
lll(arg)
if__name__=='__main__':
main(sys.argv[1:])