tests/readlink.py
author Kostia Balytskyi <ikostia@fb.com>
Mon, 13 Jun 2016 22:38:54 +0100
changeset 29359 d2168849539d
parent 29175 7bcfb9090c86
child 29485 6a98f9408a50
permissions -rwxr-xr-x
rebase: move local variable 'target' to the RR class

#!/usr/bin/env python

from __future__ import print_function

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, '->', f, 'not a symlink')

sys.exit(0)