tests/readlink.py
author Raphaël Gomès <rgomes@octobus.net>
Fri, 23 Feb 2024 15:10:44 +0100
branchstable
changeset 51438 05eba178da45
parent 48875 6000f5b25c9b
permissions -rwxr-xr-x
branching: merge default into stable for 6.7rc0

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