Closed simone-viozzi closed 10 months ago
@simone-viozzi hey, thanks. I'll try to find some time this week!
@shcheklein I noticed that there was no mkdir
method and I needed one, so I implemented it.
I also noticed that fs.expand_path
only works if the path is one level under self.path
. Example:
self.path=root/tmp/
root/tmp/fo1
root/tmp/fo1/file2.pdf
root/tmp/fo1/fo2/
root/tmp/fo1/fo2/file3.pdf
root/tmp/fo1/fo2/fo3/
root/tmp/fo1/fo2/fo3/file4.pdf
then:
print(fs.expand_path('root/tmp/fo1', recursive=True))
> ['root/tmp/fo1', 'root/tmp/fo1/file2.pdf', 'root/tmp/fo1/fo2/file3.pdf', 'root/tmp/fo1/fo2/fo3/file4.pdf']
# ( correct )
print(fs.expand_path('root/tmp/fo1/fo2/', recursive=True))
> ['root/tmp/fo1/fo2']
# ( wrong! Correct answer is: ['root/tmp/fo1/fo2', 'root/tmp/fo1/fo2/file3.pdf', 'root/tmp/fo1/fo2/fo3/file4.pdf'] )
expand_path
use find
:
The same bug happens in find as well.
I lost a good amount of time to understand why copy suddenly stopped working 😅
Can copy single files and folders, the recursive implementation is in
AbstractFileSystem.copy
.Is compatible with
AbstractFileSystem.copy
so for example:There are no tests for copy, but there is one for the
move
method, that right now is implemented ascopy + rm
, and the test passes.todo list:
@shcheklein can you please review the code? Also check if this is backward compatible with the previous implementation.
Thank you.