Commit 28b68411 by rfkelly0

make MountFS directly delegate setcontents() where possible

parent 62b99816
...@@ -143,6 +143,16 @@ class MountFS(FS): ...@@ -143,6 +143,16 @@ class MountFS(FS):
return fs.open(delegate_path, mode, **kwargs) return fs.open(delegate_path, mode, **kwargs)
@synchronize
def setcontents(self, path, contents):
path = normpath(path)
object = self.mount_tree.get(path, None)
if type(object) is MountFS.FileMount:
return super(MountFS,self).setcontents(path,contents)
fs, mount_path, delegate_path = self._delegate(path)
if fs is None:
raise ParentDirectoryMissingError(path)
return fs.setcontents(delegate_path,contents)
@synchronize @synchronize
def exists(self, path): def exists(self, 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