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

Number : 30 Date : 2001-05-16 Author : Kan Yabumoto Subject : Re: The /Z and /RX switches Size(KB) : 6
One of the challenges in writing the help text that accompanies the program is to squeeze the description into just one line. Although no one tells me to keep it within one line, multiple line descriptions would make the whole help section uncontrollably messy. On the other hand, the one-line-per-item format forces the user to guess what some of the phrases mean. We try to keep the usage of such words as consistent as possible. That is why we consider the /HELP text within the program totally inadequate for a program like XXCOPY. That was the motivation for the creation of the XXCOPY web page. But, I'm glad that questions like this one remind the XXCOPY design team to re-evaluate the phrasing in the help text and the web documentation. The key to understand many of the XXCOPY switches is to learn XXCOPY's scheme to classify files based on the combination of presence and absence in the source and the destination directories. The following chart is my favorite (appears near the bottom of the XXCOPY /HELP text). ------------------------------------------------------------------------ Summary XXCOPY switches that check two directories: ------- / src \ Files are classified into four groups; | ---+--- --------------------------------------------- | A / B | \ A files in src which do not exist in dst | | | | B files in src which also exist in dst \ | C / D | C files in dst which also exist in src ---+--- | D files in dst which do not exist in src \ dst / ------- -------------------------------------------------------------------------- The illustration shows a pair of partially overlapping regions (src and dst). Region A and Region D are the non-overlapping part which denote the "Brand New" files and the "Extra" files respectively. /BB selects files in Region A The overlapping region (B and C) is handled by the /U switch (those files which appear both in the source and destination). This group of files offer (too) many opportunities for file selection: Let me paste what the /HELP text says about the B/C Region. ---------------------------------------------------------------------------- /BB all files in A (none in B) /BI all files in A plus files in B that are different in filetime or size /BX all files in A plus files in B that are different in filetime /BZX all files in A plus files in B that are different in size /BZL all files in A plus files in B that are larger /BZS all files in A plus files in B that are smaller /BZE all files in A plus files in B that are the same size /BN all files in A plus files in B that have newer filetime /Bo all files in A plus files in B that have older filetime /BS (none in A) files in B that have exactly the same time and size /U (none in A) all files in B (subject to other switches) /U/BI (none in A) files in B that are different in filetime or size Note: all the variations in the backup switches (/Bx) includes the files in A with the exception of /BS to be consistent with the spirit of BACKUP. As shown in the example (/U/BI), adding /U eliminates the files in A. /RS files in A and/or B that satisfy other specified switches (for remove) /RC same as /RS (for remove-after-copy) /RD (none in D) files in C that would be overwritten (for remove) /RX all files in D (for remove) Note: /BS for copy usually accomplishes nothing but is useful as /RS/BS. ---------------------------------------------------------------------------- The funny thing is since the files in Region D are, by definition, not in the source, there is no switch in regular copy operation which refers to this region. However, the /Z and /RX switches specifically act on files in Region D. For lack of better word, we call the files in Region D "Extra" files. (Microsoft's ROBOCOPY utility uses the same terminology). One particularly awkward aspects of the often inconsistent and non-intuitive naming on the XXCOPY command switches is the /U switch. This is for the sake of the XCOPY-compatibility. Also, other inconsistencies have only ourselves, the designer of XXCOPY to blame. We have a few serious regrets!!! Our limit in foresight in picking the right mnemonics in the first place leaves a lasting scar to the program for a long time... But, once a switch is introduced and documented, it has to remain. As Jim mentions, the /RX switch was added as an extra bonus which could (and should) be handled by swapping the source and destination for more control. The /RX action is basically the same as the /Z switch except /RX does not engage in copying files. Kan Yabumoto =============================================================================== At 2001-05-15 23:52, you wrote: >XXCOPY has some other switches that I wondered about as I read them. For >example, the effect of the /Z switch has been described as something like >"deletes extra files/directories in the destination". > >I wondered, just what is considered to be an "extra file" in the >destination? > >Just to give a clear example - what would be the effect of: > >xxcopy c:\src\*.doc c:\dst\ /ZY > >Two possibilities: > >(1) All the files in c:\dst, besides the .doc files copied over from c:\src, >are "extra" files and are deleted. > >(2) Only the *.doc files in c:\dst that are not in c:\src are extra files >and are deleted. > >The answer is (2) - only those files in the destination which fit the source >file selection criteria (here *.doc), and which are not in the source >directory, will be deleted. (Maybe Kan could describe this >better.) > >The technical bulletin recommend that instead of using /Z or /RX (Remove >Extra) switches, it can be better to switch the source and destination >directories and use /RS/BB instead, so that the files will be deleted from >the source directory instead of the destination directory. In this case, >the following could be used in place of the above command line: > >xxcopy c:\dst\*.doc c:\src\ /RS/BB > >This command line also has the effect of deleting from c:\dst the *.doc >files that are not also in c:\src. > >jim
This message if part of XXCOPY's message Archive. The archive contains all the messages posted at Yahoo!Groups: XXCOPY.