tests/readlink.py
author Raphaël Gomès <rgomes@octobus.net>
Fri, 18 Feb 2022 12:55:39 +0100
branchstable
changeset 48776 b84ff512b645
parent 45830 c102b704edb5
child 48875 6000f5b25c9b
permissions -rwxr-xr-x
Added signature for changeset dcec16e799dd

#!/usr/bin/env python3

from __future__ import absolute_import, print_function

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)