Closed aleaksunder closed 3 years ago
copy -s
creates the directory. copy
without -s
has the same behavior as move
- if multiple files are in the source, it will error trying to copy the second file over the first. move
is in a bit of a mind because there's no such thing as move -s
, since it is always a non-recursive operation, even if it has hierarchical effects.
Although it's always easy to pick an example that makes the behavior look illogical, see how we got here - move src dest
is a valid thing to do to a single file, where dest
is a newly created file; move src\* dest
might match a single file in which case these semantics make sense. It seems very scary to have different behavior based on the number of files that are found, since the behavior will be very hard to predict.
Hello! Just hit another issue with
MOVE
Assuming we have such a tree:then I tried to move the contents of folder
dir1
to existen dirdirExist
:and all is fine here:
But when revert all back and tried to move the contents of
dir1
to not existen directory:it fails with message:
Attempting to move multiple files over a single file (\\?\C:\temp\dirNew)
and after that the tree became this:And all is fine with
COPY
in both cases... evencopy -s "dir1\*" "dirNew"
creates new "dirNew" and copies all contents of "dir1"