summaryrefslogtreecommitdiff
path: root/tests/readlink.py
blob: 0e86a67393c3359178dacb69328253ef040b0a4e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/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)