tests/readlink.py
author Adrian Buehlmann <adrian@cadifra.com>
Wed, 16 Feb 2011 15:02:30 +0100
changeset 13426 643b8212813e
parent 10282 08a0f04b56bd
child 25660 328739ea70c3
permissions -rwxr-xr-x
store: remove pointless pathjoiner parameter We can stop pretending that we have to support anything else than '/' for concatenating path elements anywhere. Windows deals just fine with '/' in file paths and we already have plenty of places which produce paths containing '/' anyway when running on Windows.

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