tests/readlink.py
author Augie Fackler <augie@google.com>
Wed, 14 Oct 2015 12:05:27 -0400
changeset 26708 749d913f24b8
parent 25660 328739ea70c3
child 29175 7bcfb9090c86
permissions -rwxr-xr-x
changegroup: document the public surface area of cg?unpackers This should help future readers at least a little.

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