![]()
[<<]Message[>>] [<<]Author[>>] [<<]Subject [<<]Thread[>>]
Number : 5032 Date : 2003-07-14 Author : james sadler Subject : Re: pathnames exceeding 255 characters - any way to deal with them? Size(KB) : 3
One trick is to use the ren command at the dos prompt. Progra~1 can be simple renamed a. The next level can be named b. If there is a single huge directory like 1234567----- then the * command can be used. For example ren 123* to any short name. --- Kan Yabumoto wrote: > > Anykey wrote: > > >I just did an XXCOPY location with an /RC switch > ... and then found that > >some files couldn't be deleted, because the > pathname exceeded the 255 > >character limited. The files were in deeply nested > folders and also the > >filenames themselves had ridiculously long names > (e.g. from the very long > >title of the saved web page). > > > > XXCOPY is not a tool to undo some irregularities in > hard disk. > It assumes that the volume it accesses is in a > healthy state. > > I believe in many cases, an illegally long overall > pathname is > a result of renaming a directory with a longer name > which pushed the overall path beyond the limit. The > Windows > system apparently does not check all the contents in > the > subdirectory when a directory name is lengthened by > a rename > operation. Moving a whole directory from one place > to another > (a form of renaming) may also result in a similar > situation. > > For example, let me illustrate how you can make an > exceedingly > long (overall) pathname. > > md \a > md \a\b > md \a\b\c > md \a\b\c\d > md \a\b\c\d\e > md \a\b\c\d\e\f > echo This is a test > \a\b\c\d\e\f\testfile.txt > > (The last line creates "testfile.txt".) > > Now, rename each of the directories to something > very long. > > ren \a\b\c\d\e\f > long_name_1234567890123456789012345678901234567890 > ren \a\b\c\d\e > long_name_1234567890123456789012345678901234567890 > ren \a\b\c\d > long_name_1234567890123456789012345678901234567890 > ren \a\b\c > long_name_1234567890123456789012345678901234567890 > ren \a\b > long_name_1234567890123456789012345678901234567890 > ren \a > long_name_1234567890123456789012345678901234567890 > > Now, each level is 50 characters long, with 6 levels > altogether, the full parent directory name (not > counting the > "lastname" and the backslashes and drive letter and > colon), > for "testfile.txt" is now 300 characters long. > Somewhere along > the above steps, the file's overall length exceeded > the limit. > But, the Windows (I'm testing this on XP-Pro) did > not complain. > > If you try to access the whole directory using the > LFN, you will > probably have problems. But, in a case like this > where there are > a lot of room to shorten the overall length by > accessing the whole > thing using the SFN counterpart, you can still > accomplish a lot. > > E.g., knowing that long_name_123456... is now > assigned the SFN of > "LONG_N~1", you may reference the "testfile.txt" by > > > \long_n~1\long_n~1\long_n~1\long_n~1\long_n~1\long_n~1\testfile.txt > > You may reference it this way to delete the file. > If you have > too many files in the directory deep inside like > this, you may > shorten the directory names. > > ren > \long_name_1234567890123456789012345678901234567890 > a > ren > \a\long_name_1234567890123456789012345678901234567890 > a > ... > > Alternatively, if the problem is just one directory > name > in between which is very long, you may run DIR /X to > find > out what is the SFN for the directory and use its > SFN name > to reach the end without renaming steps. > > Kan Yabumoto > > > __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com
This message if part of XXCOPY's message Archive. The archive contains all the messages posted at Yahoo!Groups: XXCOPY.