tests/readlink.py
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
Sat, 22 Dec 2012 17:08:15 +0100
changeset 18131 f0eeb9b3444a
parent 10282 08a0f04b56bd
child 25660 328739ea70c3
permissions -rwxr-xr-x
branchmap: make update a method

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