readlink.py
12 lines
| 231 B
| text/x-python
|
PythonLexer
/ tests / readlink.py
Thomas Arendsen Hein
|
r5683 | #!/usr/bin/env python | ||
import errno, os, sys | ||||
for f in sys.argv[1:]: | ||||
try: | ||||
print f, '->', os.readlink(f) | ||||
except OSError, err: | ||||
if err.errno != errno.EINVAL: raise | ||||
print f, 'not a symlink' | ||||
sys.exit(0) | ||||