view tests/readlink.py @ 25103:ce00b2e96d09

shelve: refactor allowables to specify sets of valid operations This will allow us to have --patch and --stat as standalone operations that don't require --list, as well as pairing them with --list.
author Tony Tung <tonytung@fb.com>
date Tue, 14 Apr 2015 16:23:07 -0400
parents 08a0f04b56bd
children 328739ea70c3
line wrap: on
line source

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