tests/readlink.py
author timeless@mozdev.org
Tue, 06 Oct 2015 15:07:00 -0400
changeset 26496 b885ab9ca182
parent 25660 328739ea70c3
child 29175 7bcfb9090c86
permissions -rwxr-xr-x
rebase: enable histedit for useful help with it

#!/usr/bin/env python

import errno, os, 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, 'not a symlink'

sys.exit(0)