Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Discrepancy in handling of "can't copy or move file to itself"

Feb
240
3
When trying to copy or move a file to itself (e.g. "copy *.* ." or "move *.* ."), the error reported is: "Can't COPY or MOVE file to itself".
However, what happens next is not always the same. If the operation is a "copy" operation, then TCC continues processing with the next file. However, if the operation is a "move" operation, TCC aborts the operation.
This means, for instance, that a command like "copy *.* . /sx" will succeed in copying all of the files from the subdirectories, while "move *.* . /sx" will not.
Is this discrepancy deliberate? (Personally, I'd prefer that TCC continue [rather than aborting] in both cases, skipping the problematic files, and continuing with the rest).
 
Avi, I think the "/O" parameter is what you want on the "Copy" and "Move" commands unless you want to copy files that have the same name from another source over the existing files in the destination directory (could be, I suppose, but I tend to doubt it...)
 
Yes, that did the trick! Thanks so much, Dan!

In any case, though, the discrepancy in the handling of the "cannot copy or move file to itself" error still seems anomalous - why should it be a critical error in "move" but a non-critical error in "copy"?

Avi, I think the "/O" parameter is what you want on the "Copy" and "Move" commands unless you want to copy files that have the same name from another source over the existing files in the destination directory (could be, I suppose, but I tend to doubt it...)
 
n any case, though, the discrepancy in the handling of the "cannot copy or move file to itself" error still seems anomalous - why should it be a critical error in "move" but a non-critical error in "copy"?

WAD (and what users had requested years ago). In the case of MOVE, the user expects the original file to be gone (and the directory removed). In the case of COPY, in the worst case the source and the target will both still be there.
 
Back
Top
[FOX] Ultimate Translator
Translate