tests/readlink.py
author Thomas Arendsen Hein <thomas@intevation.de>
Mon, 12 Mar 2012 09:39:30 +0100
branchstable
changeset 16242 55174ab81973
parent 10282 08a0f04b56bd
child 25660 328739ea70c3
permissions -rwxr-xr-x
extdiff: escape filenames with vim/DirDiff and make quoting work with Windows Use vim function fnameescape() on filenames. Use double quotes for arguments so cmd.exe is happy.

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