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

Number : 241 Date : 2001-06-20 Author : Kan Yabumoto Subject : Re: Flatten subdirectories Size(KB) : 3
Some exotic switches in XXCOPY (like /SX/SL/SR) are puzzling indeed. The obscure nature of these switches certainly make them under-utilized. But, they are hidden gems which There is no one specific purpose for the directory-flattening operation. But, they could be very useful on a number of occasions: 1. Say, you want to browse a bunch of Microsoft Word documents in one setting. You may open up the Word application and use its built-in "quick-browse" feature to locate a file. In that case, it will be much faster if the files are in one directory. In this case, the /SX is probably the best choice since it preserves the filename extension (and shows the first part as the same). There are similar cases where a particular application insists that all the files be in one directory. 2. Try this on .MP3 files. 3. Combine it with /sz0 to make a list of such files in one place. Combinations with other file-selection switches are also useful (various /D switches, size switch like /SZ:100M-). 4. You can bring all similarly-named (or the same type of) files into one directory rather than to be scattered throughout the entire subdirectories. If you were to use the regular /S switch starting with the root directory as the source (to collect from the entire volume) instead of using the flattening switch, the destination directory structure will mirror the complexity of the volume and the files will be hard to reach. 5. Try to gather just a very small number of files which are on your disk but are scattered in deeply nested directories. 6. Unlike the other similar switches (the Gather functions /SGxxx), the flattening switches (/SX/SL/SR) is reversible to reconstruct the original path from the destination. That is, in Step-1, after you make a few changes to some of the word documents, you may copy the updated file back to where it came from. In most case, the files that are collected into the destination directory of the flattening command should be regarded as temporary and should be discarded after its use. Of course, this is one good way to archive certain class of files on a semi-permanent basis. ------------------------------------------------------------------ Unfortunately, one minor (and inevitable) problem with the /SX/SL/SR switches is that the separator (default = `) character must be a legal character which is allowed in a regular file name. That means, the separator character (whichever you select) may collide with files which exist in your directory already. If such a file is encountered, the synthesized filename will not be successfully copied back to its original place when it is "unflattened". That is why we had to choose the least likely character (`) to delimit the original path components (and, that is why there is a mechanism to change the delimiter character to most other punctuation character. ------------------------------------------------------------------ In short, it is a multi-purpose function which we don't even know how you come up with even more useful applications. Kan Yabumoto ================================================================= At 2001-06-20 07:48, James McAlister wrote: >One question today: > >What are the advantages of flattening subdirectories (say, with /SL)? Can >someone comment? > >Thanks! > >James McAlister
This message if part of XXCOPY's message Archive. The archive contains all the messages posted at Yahoo!Groups: XXCOPY.