tests/readlink.py
author Martin von Zweigbergk <martinvonz@google.com>
Fri, 27 Mar 2015 15:37:46 -0700
changeset 24525 e118f74d246f
parent 10282 08a0f04b56bd
child 25660 328739ea70c3
permissions -rwxr-xr-x
manifest: extract method for creating manifest text Similar to the previous change, this one extracts a method for producing a manifest text from an iterator over (path, node, flags) tuples.

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