tests/readlink.py
author Cédric Duval <cedricduval@free.fr>
Mon, 18 May 2009 23:59:22 +0200
changeset 8510 f3ad1ed099e1
parent 5683 396c7010b0cd
child 10282 08a0f04b56bd
permissions -rwxr-xr-x
patchbomb: fix inexact description of the messages threading Each message refers only to the first of the series.

#!/usr/bin/env python

import errno, os, sys

for f in sys.argv[1:]:
    try:
        print f, '->', os.readlink(f)
    except OSError, err:
        if err.errno != errno.EINVAL: raise
        print f, 'not a symlink'

sys.exit(0)