tests/readlink.py
author Mads Kiilerich <madski@unity3d.com>
Wed, 17 Apr 2013 03:41:08 +0200
changeset 19024 ab04e87a5f3b
parent 10282 08a0f04b56bd
child 25660 328739ea70c3
permissions -rwxr-xr-x
amend: fix unlocking order - first lock then wlock

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