tests/readlink.py
author Augie Fackler <augie@google.com>
Wed, 04 May 2016 21:01:49 -0400
changeset 29084 052c9318e464
parent 25660 328739ea70c3
child 29175 7bcfb9090c86
permissions -rwxr-xr-x
bookmarks: jettison bmstore's write() method per deprecation policy

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