tests/readlink.py
author Yuya Nishihara <yuya@tcha.org>
Sat, 08 Nov 2014 13:06:22 +0900
changeset 23270 41c03b7592ed
parent 10282 08a0f04b56bd
child 25660 328739ea70c3
permissions -rwxr-xr-x
util.system: use ui.system() in place of optional ui.fout parameter

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