Page 1 of 1

LFNit! and file name preservation

Posted: Fri Oct 07, 2005 12:40 pm
by Guest
Does LFNit! make any attempt to preserve the short 8.3 filename associated with a long filename? If so, is this a well-tested feature? This is very important for a backup operation, as many programs, including Windows itself, use and store short filename internally. For example, the registry is littered with them!

Please also note that Windows NT uses a different LFN aliasing algorithm than Windows 9x. NT creates the first 4 aliases LONGNA~1 to LONGNA~4 the same, but after that, replaces all but the first two characters with a hash.

A simple, but very effective test is as follows:
1. Create a directory, such as C:\TEST.

2. In the directory, create the two subdirs SRC and DST

3. In the SRC directory, use a DOS box, or Windows Explorer, to create the files:
LongName001.txt
LongName002.txt
LongName003.txt
LongName004.txt

4. In the DOS box, you should get a listing such as:
LONGNA~1.TXT LongName001.txt
LONGNA~2.TXT LongName002.txt
LONGNA~3.TXT LongName003.txt
LONGNA~4.TXT LongName004.txt

5. Delete the LongName002.txt file. In the DOS box, you should now get the listing:
LONGNA~1.TXT LongName001.txt
LONGNA~3.TXT LongName003.txt
LONGNA~4.TXT LongName004.txt

6. Use LFNit! to backup the long filenames in the SRC directory

7. Use a non-LFN-aware program to copy the files from SRC to DST. In the DST directory, you should now get the listing:
LONGNA~1.TXT LONGNA~1.TXT
LONGNA~3.TXT LONGNA~3.TXT
LONGNA~4.TXT LONGNA~4.TXT

8. Use LFNit! to restore the backed-up long filenames to the files in DST

9. Compare the directory listings for SRC and DST. They should be *identical*. Pay particular attention to the short name associated with each long name.

Posted: Mon Oct 10, 2005 10:08 am
by DataMystic Support
The question is really the other way around for LFNit.

LFNit backs up the long filenames with their corresponding short filename. So your backup is assumed to only have the short filenames. LFNit then renames the short filenames to their original long filenames.

This will be OS independent.

LFNit! and file name preservation

Posted: Wed Oct 12, 2005 4:32 pm
by Guest
Yes, I am aware that LFNit! works by renaming short filenames to long filenames. Howewer, do not make the mistake of assuming that renaming the short name to the long name will preserve the short name alias. In fact, doing this under Win9x family (have not tested WinNT family) will guarantee that the short name alias is never preserved! For reasons I already mentioned, it is essential to preserve the short name associated with each long name, as both aliases are often used and stored internally by programs, including Windows itself.

I actually had this situation happen to me on a computer I was running Windows 95 on, while I was testing the undocumented "no numeric tail" file naming option. Somehow, a new "Program Files" directory got created with short alias "PROGRAMF". This resulted in a huge mess, as some programs were using the new "Program Files" directory (alias "PROGRAMF"), while others were still using the old "PROGRA~1" directory, which still existed!

If you still don't believe this is important, search the registry on your own computer for "~", and I guarantee you will find hundreds of registry keys referencing files by their short names, most frequently "PROGRA~1". Search again for "Program Files", and you will probably find just as many keys referencing files by long names. In some cases, I have seen two registry keys for the same program referencing "Program Files" by both its long name and its short name!

Posted: Wed Oct 12, 2005 4:48 pm
by DataMystic Support
Thanks for your clarification. We weren't aware that the short filename could change when renaming. This is a rather large (and annoying!) issue.

We don't have a solution just yet, and I can't see one happening soon. The usage of LFNit dropped tremendously with Win98 and onwards.