![]()
[<<]Message[>>] [<<]Author[>>] [<<]Subject [<<]Thread
Number : 209 Date : 2001-06-16 Author : Kan Yabumoto Subject : Re: Help - BUG ? Size(KB) : 3
No. It is not a bug. It's a feature (as all manufacturers say). Some historic perspective might help explain why XXCOPY deletes the empty directories when it simply "moves" files from one place to another. When we added the "remove" operations to the XXCOPY command set, we made four variations. What we wanted to accomplish here was to make XXCOPY's powerful file-selection features for filecopy also applied to file deletion as well. That is, the all-or-nothing proposition of the DELTREE can be substituted by XXCOPY. The migration path can be depicted like this: COMMAND.COM/COPY --> XCOPY.EXE --> XXCOPY.EXE COMMAND.COM/DEL --> DELTREE.EXE --> XXCOPY.EXE So, the four variations in the delete operations in XXCOPY are: /RS Files in the src directory will be removed /RC Source file removed after a successful copy /RD Files to be overwritten in the dst will be removed /RX Files absent in the source will be removed from dst The /RS is the most standard case in the four and the remaining three are variations of the first one. Or, putting another way, at first, we conceived /RS and /RD as a pair where instead of files being copied from the source to the destination, no files will be copied but the files involved in the process of file-selection will be removed. So, these two are the easiest to understand especially under the contest of the original file-copy mechanism. The /RX switch was complimentary to the /RD switch which can be thought of the /Z operation without copy. Then, being greedy in our quest for more power, /RC was added as a bonus. It turned out that it became quite popular once we say it's equivalent to a MOVE. One of the common features in these commands is to remove empty subdirectories in the directory where files are removed (otherwise, any directory with a subdirectory would not be removed). So, from this grouping, it makes sense to delete empty subdirectories (whether or not it became empty as a result of file deletion) in this context. And it just happens that the net effect of the /RC operation is nearly identical to a common file-MOVE operation. We are still contemplating to officially introduce a dedicated "MOVE" switch (if and when that became true, this discussion will become totally moot, since the new move operation will probably handle this case more intuitively). I kinda agree that the deletion of empty directory is counter-intuitive (and therefore, we should consider generating a warning). But, a warning with yet another user-prompt would provoke a "NOT-AGAIN" reaction. Also, it would break the symmetry in the four /R switches unless we put the prompt-before-deleting-an-empty-directory on all of the four. That would certainly create a riot around the Pixelab world headquarters!!! Therefore, we will just leave it as it is and just shrug... ---------------------------------------------------------- OK, so much for history lesson. But, there is a simple solution to this (to avoid the "side-effect" of disappearing empty directories): /ED This switch preserves empty directories which is useful in conjunction with any deletion operation ( /Z, /Z0, /CLONE, /RS, /RC, /RD, /RX ). So, those who consider /RCY to be equivalent to "MOVE", should revise the notion by taking a note that /RCY/ED is more like it. Kan Yabumoto =========================================================== At 2001-06-15 08:36, Atma Singh wrote: >I am trying to use xxcopy to MOVE selected data from >the c drive to the d drive. The line I am using is > >XXCOPY C:\*.WK4 "D:\MY DOCUMENTS" /RCY /S > >The problem is that the program deletes empty >dircetories on the C drive. WHY ? or what am I doing >wrong ? > >Thanks in advance
This message if part of XXCOPY's message Archive. The archive contains all the messages posted at Yahoo!Groups: XXCOPY.