tests/readlink.py
author Yuya Nishihara <yuya@tcha.org>
Fri, 24 Dec 2010 01:17:18 +0900
branchstable
changeset 13202 d83566f4453b
parent 10282 08a0f04b56bd
child 25660 328739ea70c3
permissions -rwxr-xr-x
notify: use util.ellipsis() to truncate long subject

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