Commit 1728ab6b by willmcgugan

Fixed an error were mountfs.makedir attempted to remake a mounted path

parent ccfc728c
......@@ -215,6 +215,11 @@ class MountFS(FS):
fs, mount_path, delegate_path = self._delegate(path)
if fs is self or fs is None:
raise UnsupportedError("make directory", msg="Can only makedir for mounted paths" )
if not delegate_path:
if allow_recreate:
return
else:
raise DestinationExistsError(path, msg="Can not create a directory that already exists (try allow_recreate=True): %(path)s")
return fs.makedir(delegate_path, recursive=recursive, allow_recreate=allow_recreate)
@synchronize
......
......@@ -432,6 +432,11 @@ if __name__ == "__main__":
#browse(m)
from osfs import *
f = OSFS('/home/will/projects')
print_fs(f)
#f = OSFS('/home/will/projects')
f=OSFS('/home/will/tests')
from fs.memoryfs import MemoryFS
mem = MemoryFS()
from fs.utils import copydir
copydir(f, mem)
print_fs(mem)
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