tests/readlink.py
author Raphaël Gomès <rgomes@octobus.net>
Mon, 04 Nov 2024 15:23:41 +0100
changeset 52311 f7b2806035a7
parent 48875 6000f5b25c9b
permissions -rwxr-xr-x
rust: update `clap` to the latest 4.x version This brings in more up-to-date dependencies, some bug fixes (none of which are relevant yet), and slightly improved compile times.

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