tests/readlink.py
author Raphaël Gomès <rgomes@octobus.net>
Mon, 07 Aug 2023 11:05:43 +0200
branchstable
changeset 50818 04d5cde28a7f
parent 48875 6000f5b25c9b
permissions -rwxr-xr-x
Added signature for changeset 787af4e0e8b7

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