tests/readlink.py
author Raphaël Gomès <rgomes@octobus.net>
Mon, 06 Nov 2023 15:38:27 +0100
branchstable
changeset 51117 f6bb9d1c230c
parent 48875 6000f5b25c9b
permissions -rwxr-xr-x
Added signature for changeset c083d9776cb2

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