tests/readlink.py
author Augie Fackler <raf@durin42.com>
Mon, 23 Jun 2014 09:23:47 -0400
changeset 21792 e15c991fe2ec
parent 10282 08a0f04b56bd
child 25660 328739ea70c3
permissions -rwxr-xr-x
check-seclevel: restore use of callable() since it was readded in Python 3.2

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