tests/readlink.py
author Martin von Zweigbergk <martinvonz@google.com>
Wed, 11 Mar 2015 13:46:15 -0700
changeset 24295 2b7ab29627fd
parent 10282 08a0f04b56bd
child 25660 328739ea70c3
permissions -rwxr-xr-x
lazymanifest: add iterkeys() method So we don't have to iteratate over (path, node, flags) tuples only to throw away the node and flags.

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