tests/readlink.py
author Mads Kiilerich <mads@kiilerich.com>
Wed, 12 Dec 2012 02:38:14 +0100
changeset 18369 2150e70c0ee1
parent 10282 08a0f04b56bd
child 25660 328739ea70c3
permissions -rwxr-xr-x
churn: sort users with same churn by name This makes the output order well-defined and improves code readability.

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