when copying, subdirectories are not created
balta2ar opened this issue · 2 comments
balta2ar commented
my usecase was to copy some of the files located in various subdirs into a single root subdir, e.g.
1 ./2/b.txt
2 ./1/a.txt
after editing
1 ./2/b.txt
2 ./1/a.txt
1 ./tmp/2/b.txt
2 ./tmp/1/a.txt
I get
Copy "2/b.txt" to "tmp/2/b.txt" ERROR: [Errno 2] No such file or directory: 'tmp/2/b.txt'
Copy "1/a.txt" to "tmp/1/a.txt" ERROR: [Errno 2] No such file or directory: 'tmp/1/a.txt'
balta2ar commented
It is possible to work around it with 2 invocations though:
- first by adding a prefix to the filenames -- i.e. using copy that doesn't require creation of new dirs
- then by removing prefix and adding a root prefix subdir -- rename works fine if it needs to create a new directory
but it would have been be more convenient if copy could create the whole path
bulletmark commented
Fixed by commit c0108a7.