Commit b5b04d5d by rfkelly0

delegate xattr methods in MountFS

parent 8d1e513f
...@@ -255,3 +255,44 @@ class MountFS(FS): ...@@ -255,3 +255,44 @@ class MountFS(FS):
return fs.getinfo(delegate_path).get("size", None) return fs.getinfo(delegate_path).get("size", None)
@synchronize
def getxattr(self,path,name,default=None):
path = normpath(path)
fs, mount_path, delegate_path = self._delegate(path)
if fs is None:
raise ResourceNotFoundError(path)
if fs is self:
return default
return fs.getxattr(delegate_path,name,default)
@synchronize
def setxattr(self,path,name,value):
path = normpath(path)
fs, mount_path, delegate_path = self._delegate(path)
if fs is None:
raise ResourceNotFoundError(path)
if fs is self:
raise UnsupportedError("setxattr")
return fs.setxattr(delegate_path,name,value)
@synchronize
def delxattr(self,path,name):
path = normpath(path)
fs, mount_path, delegate_path = self._delegate(path)
if fs is None:
raise ResourceNotFoundError(path)
if fs is self:
return True
return fs.delxattr(delegate_path,name)
@synchronize
def listxattrs(self,path):
path = normpath(path)
fs, mount_path, delegate_path = self._delegate(path)
if fs is None:
raise ResourceNotFoundError(path)
if fs is self:
return []
return fs.listxattrs(delegate_path)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment