[<<]Message[>>]    [<<]Author[>>]    [<<]Subject[>>]    [<<]Thread[>>]

Number : 5061 Date : 2003-07-22 Author : Kan Yabumoto Subject : Re: /RX switch problem.... Size(KB) : 9
Garry wrote: >--- In xxcopy@yahoogroups.com, "thoughtsandideas" wrote: > > > I didn't know you could press "?" to see switches that > > would suppress the prompt; I'll try that. > > > > Also, you said: > > > >> For example, /clone uses /PD0 which suppresses > >> prompting before each directory copy/remove > > > > If that's true, then it's broken, because I *do* get > > prompted... anytime it's about to delete a dst dir that's > > absent in the src. And that's without using /RX. /RX just > > adds more prompts -- it prompts me to delete dirs that it > > shouldn't even be deleting, because they *do* exist in the > > src. > >Interestingly, Andreas also reported a similar problem with >prompting when using /clone. I can't replicate your problem >but maybe there is a bug. I assume the source is a network >drive. What is the destination? If you don't sort it out, try >the following command then cut and paste the contents of >xxcopy.log back here. Also advise which directories you are >being prompted on - is there anything unusual about the names? > >xxcopy z:\data\ k:\backup\data\ /CLONE/FF/NX0/PZ0/ON:xxcopy.log Sorry for my long explanation but I need to give you detailed account for what went on to the design of the features in question. (This message looks like a technical bulletin.) Let me concentrate on the original combination that is alleged to have a bug. /CLONE /RX (I will come back to the "funny combination" of the two). I'm not sure if XXCOPY is really trying to delete anything which should not be. My guess is that the way /PD prompt is worded is giving the impression that XXCOPY is trying to delete the whole directory. Let me concede that the wording, due to the limited number of characters to use in the context may give such an impression. Say, you run the following command: xxcopy \dir1\ \dir2\ /clone /rx Now, /RX being a destructive command, it gives you two levels of prompt. First, because it is a file-delete operation, it gives you a file-by-file prompt \dir2\myfile1.txt Delete (Y/N/A) ? This one is the easiest one to understand. To suppress this type of confirmation prompt, you need to put /RXY. (actually, /RX /Y is equivalent to /RXY, but we discourage the use of /Y in this context because /Y was originally designed (by Microsoft's XCOPY) to give a prompt for an overwrite of existing file in the destination. In order to provide fine control for a large scale file deletion (which is what XXCOPY is really aiming), we feel it is not sufficient for all-or-nothing, or one-by-one only control. Therefore, we created the /PD switch (stands for Prompt-on-each-directory). XXCOPY implicitly adds the /PD switch on all destructive operations. So, unless you explicitly add /PD0, any of the removal operations (/RS, /RD, /RC, /RX) will come with the silent /PD switch. The idea for /PD is that it will give you the complex (flexible) prompt everytime XXCOPY is about to process a directory. E.g., xxcopy \src\ \dst\ /s /pd // for non-destructive action Before XXCOPY starts to process a new subdirectory, say, \src\dir1\ xxcopy will prompt Dir (Y/N/A/R/S) ? for which you may reply Y // yes on this directory N // no (skip) this directory A // yes to this and all of the rest (this is essentially to dismiss the prompt for good) R // yes to this and the rest of the sister directories (but not aunt directories nor cousin directories) S // yes to this and all of its subdirectories Notice that with the /PD function, you will have more than the common /Y/N/A prompt (which is only slightly better than an all-or-nothing choice). OK, let me use graphic illustration. I like to use female for a directory and male for file. +--mother | | | +------older sister (already processed) | | | +------me (current dir) | | | | | +------- daughter1 | | | | | | | +------- grandson1 (file) | | | | | +--------daughter2 | | | | | +--------son1 (file) | | | +----- sister2 | | | | | +--------nephew1 | | | +----- sister3 | +--aunt1 | +--aunt2 Y will enable processing me and my offsprings N will skip me (therefor, all of my offsprings) A will discard the prompt for good R will enable me (and my offsprings plus sisters) S will enable me and daughters and sons and grandchildren Y and N is self explanatory. Note, Y does not automatically enable my daughters or sons. The remaining three choices are in the order of the scope of their effects. If we want to skip daughter1 (and grandson1), but to process daugher2 (and its offsprings), such selection should not affect our ability to control sister2 and sister3 independently. Also, whatever we choose to control near me (and my sisters) should not force us to give up control on aunt1 and aunt2. That is why the "R" (rest of my immediate family) is handy. (but, it is hard to explain and certainly hard for typical users to understand this) This is more complete coverage on this topic than any other material that I have documented so far. Here, I used the word "enable" because /PD is not always for file deletion but can be for file copy (usually, the /PD switch is implicitly introduced to "protect" user files from accidental deletion). So, if you run any of /RS, /RC, /RD, /RX (and /Z, you will get /PD (which requires /PD0 to disable it). As to the wording of the prompt for /PD, I said earlier for copy operations it is in the form of Dir (Y/N/A/R/S) ? For file-removal operations, the /PD prompt will say RmDir (Y/N/A/R/S) ? We could have used the uniform, "Dir (Y/N/A/R/S) ?", but we chose this wording to emphasize the deletion aspect of it. But, it does not say files will be deleted even if you respond by "Y" at this point. This prompt is simply a gatekeeper of the entrance of a directory. To prove this (you can experiment this without jeopardizing your files). xxcopy \src\ \dst\ /rx /s /pd Since you did not say /rxy nor /y, the command will give you not only the directory-by-directory prompt, it will give you file-by-file prompt. So, you may respond to the first prompt RmDir (Y/N/A/R/S) ? by typing "Y" to it. The prompt will be overwritten and you will see Directory Processed at the place where you saw the RmDir ... prompt. But, immediately at the next file, it will prompt you by \src\dir1\myfile1.txt Delete (Y/N/A) ? This (file-by-file) prompt is controlled independently from the group of /PD prompt --- as I said earlier, there are two levels of prompting. I know this is confusing. If you don't like the idea, you may permanently forget about it by always adding /PD0 and you will have one less thing to worry. But, we have responsibility to make sure that XXCOPY users (especially new users) won't lose a lot of files before becoming familiar with XXCOPY. (If the tools does not perform any deletion, we would not be as paranoia about this). I know, this aspect of the prompt control is quite messy. It is probably not the best way dealing with the problem. But, you have to remember that XXCOPY is designed to handle thousands of files. Therefore, an All-or-nothing prompt control or one-by-one prompt is not sufficient. I as the designer of this prompt feature get annoyed like everyone else. Whenever I use a manual invocation of XXCOPY for deletion, I still prefer to let the default /PD feature enabled rather than disabling it by /PD0. Yes, I will be annoyed and after several keystrokes of 'Y', I will use 'R' or even 'A'. I don't use the 'S' very often but have used many times. File deletion is always mentally exhausting operation. Since XXCOPY does not let you "undelete", you need the two level protection (on-directory and on-file). It is messy. But, we have to get used to it. Of course, these are features for manual control. Once you create a batch file, you need to suppress the prompts. --------- Now, as to the combination of /CLONE and /RX. /CLONE is essentially /BI/ZY (copy operation with Zapping the extra files) where as /RX is Zapping the extra without file-copy. The files selected by /ZY and /RX for deletion are identical. By paring /CLONE and /RX, you are giving up the /BI (copying aspect) of /CLONE but still taking advantage of the other combination /S. But, it would be simpler (and preferred) to say /RX/S. I now regret that we created the /RX function. When it was invented, we wanted to provide the functionality of /ZY without copying files. We were aware of the better alternative (/RS/BB) to the /RX operation. But, /RX being related to the popular /ZY function made sense at that time. But, the prompt control for the /ZY operation as well as the /RX is getting too messy indeed. My recommendation for you us to reverse the order of the directory arguments. Instead of XXCOPY \SRC\ \DST\ /RX/S better use XXCOPY \DST\ \SRC\ /RS/BB/S The reason why the second one is superior is because you may use a lot more file-selection mechanisms such as /DA/DB/SZ:/H/R/AT/AX which won't have effect in the first case. This is almost a hidden pitfall. Whether you like it or not, these switches have no effect on an /RX operations. That is because /RX is a special case of /Z and most experienced XXCOPY users will agree that /Z must not be affected by the read-only attribute or anything. That is why if you really want to have a fine control of what files are to be deleted, you should bring the target files onto the center stage (the first argument). Let me come back to my original message: I don't think the alleged bug with /CLONE /RX combination really exists. It is just the poor wording in the prompt which misleads many people. Thanks for reading this long message. Kan Yabumoto
This message if part of XXCOPY's message Archive. The archive contains all the messages posted at Yahoo!Groups: XXCOPY.