tests/readlink.py
author Simon Heimberg <simohe@besonet.ch>
Sat, 09 Nov 2013 14:50:12 +0100
changeset 20014 30eced973b28
parent 10282 08a0f04b56bd
child 25660 328739ea70c3
permissions -rwxr-xr-x
check-code: document last ignore regexp For easier remembering to delete when it is not needed anymore.

#!/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)