tests/readlink.py
author Matt Mackall <mpm@selenic.com>
Sun, 01 May 2016 13:52:26 -0500
branchstable
changeset 29050 27ad6cae7785
parent 25660 328739ea70c3
child 29175 7bcfb9090c86
permissions -rwxr-xr-x
Added signature for changeset f85de28eae32

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