tests/readlink.py
author Andrei Polushin <polushin@gmail.com>
Thu, 12 Jan 2012 02:12:00 +0700
changeset 15866 4a9387a97d5e
parent 10282 08a0f04b56bd
child 25660 328739ea70c3
permissions -rwxr-xr-x
i18n-ru: editorial for 'diff' * * * i18n-ru: editorial for 'diff'

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