tests/readlink.py
author Mads Kiilerich <madski@unity3d.com>
Sat, 17 Oct 2015 00:58:46 +0200
changeset 26781 1aee2ab0f902
parent 25660 328739ea70c3
child 29175 7bcfb9090c86
permissions -rwxr-xr-x
spelling: trivial spell checking

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