![]()
[<<]Message[>>] [<<]Author[>>] [<<]Subject[>>] [<<]Thread
Number : 49 Date : 2001-05-16 Author : Kan Yabumoto Subject : Re: xxcopy switches, etc. Size(KB) : 4
Dear Joseph: Let me comment on the /NX0 switch only and the related issues. >P.S. does the /NX0 switch mean that I will get a file overwritten in >the situation I described previously with short filenames ending in ~1? No. /NX0 simply disables the extra effort XXCOPY would normally perform to preserve the SFN. That is, unless you use some exotic switch to manipulate the behavior of XXCOPY with regard to the filename such as /N (to force it to use the SFN as the primary key to handle files), XXCOPY performs the file copy operation using the LFN. That is, on any given directory (under Win9x,ME,NT/2000, etc.) all files are unique with regard to the key name (say, the LFN). This is true whether or not your destination directory has the primary (LFN/SFN) name which ends with ~1. Assuming you have the exactly the same name in the source (say the same something~1), the name XXCOPY uses as the key to match the file between the source and the destination will be exactly the same. Therefore, XXCOPY would perform the "CORRECT" operation by reading the something~1 from the source and writing something~1 in the destination as it should. Moreover, if you have a discrepancies between the source directory and the destination directory with regard to the files in question, for example, Before the copy (XXCOPY \SRC \DST) Source Destination ----------------------------------------------------------- LFN (SFN) LFN (SFN) My_Long_Name (MYLONG~1) MYLONG~1 (MYLONG~1) After the copy Source Destination ----------------------------------------------------------- LFN (SFN) LFN (SFN) My_Long_Name (MYLONG~1) MYLONG~1 (MYLONG~1) MY_Long_Name (MYLONG~2) Here, since the MYLONG~1 name has already been taken by the existing file, the newly copied file (My_Long_Name) cannot assume the same SFN. If you use the /N (to use the SFN as the primary key for copy) Before the copy (XXCOPY \SRC \DST /N) Source Destination ----------------------------------------------------------- LFN (SFN) LFN (SFN) My_Long_Name (MYLONG~1) MYLONG~1 (MYLONG~1) After the copy Source Destination ----------------------------------------------------------- LFN (SFN) LFN (SFN) My_Long_Name (MYLONG~1) MYLONG~1 (MYLONG~1) In this case, these two files are the same based on the primary key (MYLONG~1). I assume your original question was referring to this type of situation and you were afraid that this could have happened with (/NX0). I answered no. But, you could have made this happen by /N switch as shown. Here's another case Before the copy (XXCOPY \SRC \DST) Source Destination ----------------------------------------------------------- LFN (SFN) LFN (SFN) MYLONG~1 (MYLONG~1) MYLONG~1 (MYLONG~1) MYLONG~2 (MYLONG~2) MYLONG~2 (MYLONG~2) After the copy Source Destination ----------------------------------------------------------- LFN (SFN) LFN (SFN) MYLONG~1 (MYLONG~1) MYLONG~1 (MYLONG~1) MYLONG~2 (MYLONG~2) MYLONG~2 (MYLONG~2) These are the result whether you use the /NX0 or not. Please note that when you have a filename such as MYLONG~1 (MYLONG~1) that is a result of previous file-copy operations which went pretty bad (likely to be a result of them being copied in a SFN-only environment) unless you intentionally named as such. When you have such files, the damage has already been done and little you can do much later. You could correct the situation immediately after the operation if the source files are still available using XXCOPY \src \dst /S /NL (This is not a copy operation but a special renaming operation). Before the operation (XXCOPY \SRC \DST /S /NL) Source Destination ----------------------------------------------------------- LFN (SFN) LFN (SFN) My_Long_Name (MYLONG~1) MYLONG~1 (MYLONG~1) After the operation Source Destination ----------------------------------------------------------- LFN (SFN) LFN (SFN) My_Long_Name (MYLONG~1) My_Long_Name (MYLONG~1) Voila!!! -------- Let me say just one thing. The problems shown here are basically a result of having the tremendous mess that Microsoft introduced to the computing world when they engineered the LFN/SFN stuff as they implemented in Windows NT/95 back in early 1990s. The troubles all started when you give two distinct names for one object and you let either of the name to represent the object. When you propagate (copy) it, the two names are allowed to be split and be merged with a new combination. If Microsoft had chosen to perform a similar operation as what XXCOPY does using the technique used in /NX operation, then, the LFN/SFN pair would have propagated properly from one directory to another (in some cases, this forces to overwrite existing file in the destination but at least the integrity of the system with regard to the names would be preserved. Now, what we have is a mess. Your headache of having ~1 names is generally a sign of compromised directory. Kan Yabumoto ========================================================================
This message if part of XXCOPY's message Archive. The archive contains all the messages posted at Yahoo!Groups: XXCOPY.