tests/readlink.py
author Mads Kiilerich <madski@unity3d.com>
Wed, 15 Oct 2014 04:08:06 +0200
changeset 22944 5aae3dea8044
parent 10282 08a0f04b56bd
child 25660 328739ea70c3
permissions -rwxr-xr-x
revset: better naming of variables containing the value of a single argument Calling them args is not helpful.

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