X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/python-afs.git/blobdiff_plain/f95acfabee62680cab0d953596cc7539585caff8..b468bb0ba304169485223cbb146febdece12e4cc:/afs/fs.py diff --git a/afs/fs.py b/afs/fs.py index 0044c05..a12b365 100644 --- a/afs/fs.py +++ b/afs/fs.py @@ -1,2 +1,13 @@ -import _fs -from _fs import whichcell +import errno +import afs._fs +from afs._fs import whichcell + +def inafs(path): + """Return True if a path is in AFS.""" + try: + whichcell(path) + except OSError, e: + if e.errno in (errno.EINVAL, errno.ENOENT): + return False + + return True