projects
/
invirt/packages/python-afs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
f95acfa
)
Add an fs.inafs function for determining if a path is in AFS at all.
author
Evan Broder
<broder@mit.edu>
Thu, 19 Nov 2009 07:55:34 +0000
(
02:55
-0500)
committer
Evan Broder
<broder@mit.edu>
Thu, 19 Nov 2009 07:55:59 +0000
(
02:55
-0500)
Signed-off-by: Evan Broder <broder@mit.edu>
afs/fs.py
patch
|
blob
|
history
diff --git
a/afs/fs.py
b/afs/fs.py
index
0044c05
..
a90cd4c
100644
(file)
--- a/
afs/fs.py
+++ b/
afs/fs.py
@@
-1,2
+1,13
@@
+import errno
import _fs
from _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