diff options
author | rfkelly0 <rfkelly0@67cdc799-7952-0410-af00-57a81ceafa0f> | 2009-06-07 07:46:28 +0000 |
---|---|---|
committer | rfkelly0 <rfkelly0@67cdc799-7952-0410-af00-57a81ceafa0f> | 2009-06-07 07:46:28 +0000 |
commit | 6a807c66efaf46a71b0850e8b1b5707c3d0eee76 (patch) | |
tree | bc14bba31b458f57b31128a44049c046e3547139 | |
parent | 46603dde5422913bb65e4448cbce87a2efb67015 (diff) | |
download | pyfilesystem-6a807c66efaf46a71b0850e8b1b5707c3d0eee76.tar.gz |
more robust xattr handling for expose.fuse
git-svn-id: http://pyfilesystem.googlecode.com/svn/branches/rfk-ideas@160 67cdc799-7952-0410-af00-57a81ceafa0f
-rw-r--r-- | fs/expose/fuse/__init__.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/fs/expose/fuse/__init__.py b/fs/expose/fuse/__init__.py index 6443279..156aa96 100644 --- a/fs/expose/fuse/__init__.py +++ b/fs/expose/fuse/__init__.py @@ -55,6 +55,7 @@ import pickle from fs.base import flags_to_mode from fs.errors import * from fs.path import * +from fs.xattrs import ensure_xattrs import fuse_ctypes as fuse try: @@ -129,7 +130,7 @@ class FSOperations(Operations): """FUSE Operations interface delegating all activities to an FS object.""" def __init__(self,fs,on_init=None,on_destroy=None): - self.fs = fs + self.fs = ensure_xattrs(fs) self._fhmap = {} self._on_init = on_init self._on_destroy = on_destroy @@ -181,9 +182,13 @@ class FSOperations(Operations): @handle_fs_errors def getxattr(self,path,name,position=0): try: - return self.fs.getxattr(path,name) + value = self.fs.getxattr(path,name) except AttributeError: raise UnsupportedError("getxattr") + else: + if value is None: + raise OSError(errno.ENOENT,"no attribute '%s'" % (name,)) + return value @handle_fs_errors def link(self,target,souce): @@ -386,7 +391,6 @@ class MountProcess(subprocess.Popen): cmd = [sys.executable,"-c",cmd] super(MountProcess,self).__init__(cmd,**kwds) os.close(w) - print os.getpid(), "WAITING" os.read(r,1) def unmount(self): |