tests/readlink.py
author Wagner Bruna <wbruna@yahoo.com>
Sun, 26 Jul 2015 09:28:52 -0300
branchstable
changeset 25874 3e84f40232c7
parent 25660 328739ea70c3
child 29175 7bcfb9090c86
permissions -rwxr-xr-x
repair: fix typo in warning message

#!/usr/bin/env python

import errno, os, sys

for f in sys.argv[1:]:
    try:
        print f, '->', os.readlink(f)
    except OSError as err:
        if err.errno != errno.EINVAL:
            raise
        print f, 'not a symlink'

sys.exit(0)