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

Number : 3451 Date : 2003-01-05 Author : Kan Yabumoto Subject : Re: How is the /IN supposed to work? Size(KB) : 4
Boy, you are using a very old version of XXCOPY. It's one year old. (But, v.2.80.3 was a stable release and nothing wrong using it.) The /IN switch unlike most other switches is "additive" in its effect. That is, nearly *ALL* other switches that is involved in the file selection mechanism are based on elimination. For example, when you use /A, it excludes files that do not have the archive bit. When you use /SZ:-10K, files that are larger than 10 KB in size will be excluded from the operation. The /X switch is more direct in its purpose by using the filename pattern as the criteria for exclusion but as you can see many non-/X switches are actually for exclusion. ------------------------------------------------------------------- The effect of the exclusion-based file selection is reinforced when you list the current set of switches by adding /? in your command line. The detailed list will give you alternate switches in group and you will find the wording that deliberately reflects the fact the switches work as an excluding element. ------------------------------------------------------------------- Now, the /IN switch operates in a different "level" of file selection. When you add more /IN switches, the more inclusions will be added to the alternate pattern set of the lastname. Anywhere in the list of /IN switches has something very inclusive, that will overshadow everything else which is covered by the very inclusive one. Let me go back to how multiple /IN specifiers are organized. I just show three cases of giving the lastname patterns xxcopy c:\mydir\pattern1 d:\dest\ xxcopy c:\mydir\pattern1 d:\dest\ /INpattern2 xxcopy c:\mydir\pattern1 d:\dest\ /INpattern2 /INpattern3 The first one is the basic XXCOPY command where the source specifier implicitly contains the first pattern. The second example shows the case with two lastname patterns. The second one uses the /IN switch. The third example shows the case with three alternate lastname-patterns. ----------------------------------------------------------------- Note that XXCOPY does not care where you place the switches (switches that starts with /) except that the source and destination specifiers (they do not start with a slash) must be in that order. That is, the following lines are equivalent to the third example above: xxcopy \INpattern2 c:\mydir\pattern1 d:\dest\ /INpattern3 xxcopy \INpattern2 c:\mydir\pattern1 /INpattern3 d:\dest\ ----------------------------------------------------------------- If you use a command line similar to the third one, when any of the three patterns has "*" (everything), then, it will overshadow everything else. Similarly, if you put a complimentary set of patterns such as "A*" and "?X*" then, it also covers everything (the first pattern insists on the first letter must be 'A' but the second pattern says any letter for the first position is OK). One thing that bothers the designer's aesthetic sense is that the above examples are not symmetrical. Since we have three alternate lastname patterns to specify, we should use three set of /IN switches. Yes, you may do so. xxcopy c:\mydir\ d:\dest\ /INpattern1 /INpattern2 /INpattern3 This is very much like how Robocopy approaches the same problem. In the case of Robocopy, the above command will be robocopy c:\mydir pattern1 pattern2 pattern3 d:\dest Note that XXCOPY's normal treatment of the source specifier is that if the lastname pattern is omitted from the source specifier (i.e., the source specifier gives just the source directory name only), then it implicitly treat the source specifier as if everything "*" is included. That is, the following two are equivalent: xxcopy c:\mydir\ d:\dest\ xxcopy c:\mydir\* d:\dest\ This default behavior is true only when there is no /IN switch is present. But, if you have an /IN switch in the command line, then, XXCOPY makes no such assumption that the source specifier implicitly uses "*" as the first lastname-pattern. That is, xxcopy c:\mydir\ d:\dest\ xxcopy c:\mydir\ d:\dest\ /IN* When there is no lastname pattern was given in the source specifier, XXCOPY automatically adds /IN* as the first and the only lastname-specifier. If the user explicitly gives an /IN switch, /IN* won't be added. This principle is the same with Robocopy (assumes everything if no lastname-pattern is given). So, c.r.p's problems go away if the first asterisk is removed from his command line. Kan Yabumoto ================================================================= At 2003-01-05 14:48, you wrote: >Below is the log from one of my many attempts. >How am i supposed to get xxcopy to just copy the extensions i want by >using the /IN switch? > >D:\AUTORUN.INF -> C:\temp\AUTORUN.INF >D:\CDROM_S.40 -> C:\temp\CDROM_S.40 >D:\include.txt -> C:\temp\include.txt >D:\Log.txt -> C:\temp\Log.txt >D:\sp6i386.exe -> C:\temp\sp6i386.exe >D:\store.dbf -> C:\temp\store.dbf >D:\wnrsqntz.exe -> C:\temp\wnrsqntz.exe
This message if part of XXCOPY's message Archive. The archive contains all the messages posted at Yahoo!Groups: XXCOPY.