tests/readlink.py
author Raphaël Gomès <rgomes@octobus.net>
Thu, 28 Jul 2022 14:11:53 +0200
branchstable
changeset 49410 82efc31bd152
parent 48875 6000f5b25c9b
permissions -rwxr-xr-x
Added signature for changeset f69bffd00abe

#!/usr/bin/env python3


import errno
import os
import 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)