tests/readlink.py
author Siddharth Agarwal <sid0@fb.com>
Wed, 03 Feb 2016 09:23:31 -0800
branchstable
changeset 27977 b698abf971e7
parent 25660 328739ea70c3
child 29175 7bcfb9090c86
permissions -rwxr-xr-x
rebase: don't preserve most extra fields This backs out changeset 88fde8db5307. See the previous patches for why.

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