tests/readlink.py
author Anton Shestakov <av6@dwimlabs.net>
Fri, 11 Mar 2016 22:29:20 +0800
changeset 28468 0d6b3630b9a3
parent 25660 328739ea70c3
child 29175 7bcfb9090c86
permissions -rwxr-xr-x
similar: specify unit for ui.progress when operating on files

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