Studying for the A+, Network+ or Security+ exams? Get over 2,600 pages of FREE study guides at CertiGuide.com!|
Join the PC homebuilding revolution! Read the all-new, FREE 200-page online guide: How to Build Your Own PC!
NOTE: Using robot software to mass-download the site degrades the server and is prohibited. See here for more.
Find The PC Guide helpful? Please consider a donation to The PC Guide Tip Jar. Visa/MC/Paypal accepted.
|Take a virtual vacation any time at DesktopScenes.com - view my art photos online for FREE in either Flash or HTML!|
Long File Names
Until the initial release of Windows 95, all file names using DOS or Windows 3.x (which uses the DOS file system) were limited to the standard eight character file name plus three character file extension. This restriction tends to result in users having to create incredibly cryptic names, and having the situation still like this 15 years after the PC was invented seemed laughable, especially with Microsoft wanting to compare its ease of use to that of the Macintosh. Users want to name their files "Mega Corporation - fourth quarter results.DOC", not "MGCQ4RST.DOC". The second name makes sense when you create it, because you know what you're saving in the file. A few months later, however, that name will probably be nearly impossible to decipher. Users didn't enjoy this limitation.
Microsoft was determined to bring long file names (LFNs) to Windows 95 much as it had for Windows NT. The latter, however, has a new file system designed from the ground up to allow long file names--NTFS. Microsoft had a big problem on its hands with Windows 95: it wanted to maintain compatibility with existing disk structures, older versions of DOS and Windows, and older applications. It couldn't just "toss out" everything that came before and start fresh, because doing this would have meant no older programs could read any files that used the new long file names. File names were restricted to "8.3" (standard file name sizes) within the directories on the disk if they wanted compatibility to be continued.
What Microsoft needed was a way to implement long file names so that the following goals were all met:
Long file name support was provided as part of the Virtual FAT (VFAT) system created for Windows 95. The VFAT file system accomplishes these goals, for the most part, as follows. Long file names of up to 255 characters per file can be assigned to any file under Windows 95 or by any program written for Windows 95 (although file names under 100 characters are recommended so that they don't get too cumbersome to use). Support for these long file names is also provided by the version of DOS (7.x) that comes with Windows 95. File extensions are maintained, to preserve the way that they are used by software. The long file name is limited to the same characters as standard file names are, except that the following additional characters are allowed: + , ; = [ ].
Note: The VFAT system for
file names was created for Windows 95, and kept for subsequent versions of Microsoft
operating systems. This includes Windows 98 and Windows ME. The FAT32 file system builds
on VFAT and also uses the same scheme.
To allow access by older software, each file that uses a long file name also has a standard file name alias that is automatically assigned to it. This is sometimes called a short file name to distinguish it from a long file name. Aliasing is performed by truncating and modifying the file name as follows:
So to take our example from before, "Mega Corporation - fourth quarter results.DOC" would be stored as shown, but also under the alias "MEGACO~1.DOC". If you had previously saved a file called "Mega Corporation - third quarter results.DOC" in the same directory, then that file would be "MEGACO~1.DOC" and the new one would be "MEGACO~2.DOC". Any older software can reference the file using this older name. Note that using spaces in long file names really doesn't cause any problems because Windows 95 applications are designed knowing that they will be commonly used, and because the short file name alias has the spaces removed.
Long file names are stored in regular directories using the standard directory entries, but using a couple of tricks. The Windows 95 file system creates a standard directory entry for the file, in which it puts the short file name alias. Then, it uses several additional directory entries to hold the rest of the long file name. A single long file name can use many directory entries (since each entry is only 32 bytes in length), and for this reason it is recommended that long file names not be placed in the root directory of a VFAT partition, where the total number of directory entries is limited. (FAT32 removes this restriction, but it's still good form to avoid putting lots of files in the root directory of a partition.)
In order to make sure that older versions of software don't get confused by this non-standard usage of directories, each of the extra directory entries used to hold long file name information is tagged with the following odd combination of file attributes: read-only, hidden, system and volume label. The objective here is to make sure that no older versions of DOS try to do anything with these long file name entries, and also to make sure they don't try to overwrite these entries because they think they aren't in use. That combination of file attributes causes older software to basically ignore the extra directory entries being used by VFAT, because prior to the creation of long file names, such a combination of file attributes had no valid meaning. (This was a major league kludge on the part of Microsoft, but one that works!)
While long file names are a great idea and improve the usability of Windows 95, Microsoft's streeeeeetch to keep them compatible with old software kind of shows. Basically, the implementation is a hack built on top of the standard FAT file system, and there are numerous problems that you should be aware of when using LFNs:
Overall, long file names are a useful advance in the usability of the FAT file system, but you need to be aware of problems when using them, especially with older software.
Next: File Attributes