Long File Names


If you have arrived here through a search engine, and there's no menu to the left click here!

With the release of Windows® 95, users were released from the bonds of the standard eight character file name and three character file extension for file naming conventions that had been imposed by the earlier MS-DOS® file system. Although Microsoft began moving to long file name conventions with the advent of Windows® for Workgroups, it wasn't fully implemented until the development and release of Windows® 95 with its VFAT (Virtual File Allocation Table). If you are a recent computer user, you might well imagine the rather inventive, yet cryptic, file names earlier users had to develop for their files in order to identify them given the limitation to only eight (8) characters. Although an inventive (but cryptic) name might make complete sense at the time you create it, six months down the road might present a problem when trying to find a file. Given Microsoft's "ease of use" competition with Macintosh, it is quite surprising that they waited until the development of Windows® 95 to solve this.

When Microsoft developed Windows® NT, it also developed NTFS (New Technology File System), which had been developed from the ground up by Microsoft and included long file name support. Microsoft was determined to bring long file name support to Windows® 95, however, doing so would involve a struggle. Microsoft needed to maintain compatibility with existing disk structures, older versions of DOS, previous versions of Windows, as well as older applications designed around these earlier operating systems. Unfortunately they couldn't merely discard everything that had come before as they had with Windows® NT. Microsoft needed to work with the restriction of "8.3" (standard file name sizes) file names within the directories if they wanted create compatibility.

Microsoft had a lofty set of goals to meet in order to insure compatibility:

As we mentioned above, during the development of Windows® 95, Microsoft also developed (VFAT), a Virtual File Allocation Table file system. For the most part, VFAT accomplishes each of the goals identified by Microsoft's engineers.

Although created for Windows® 95, VFAT was retained for all subsequent versions of Microsoft's 9x operating systems, which included Windows® 98 and Windows® ME. The FAT 32 file system was built around VFAT, and uses the same conventions.

In order to create compatibility and permit access by older software packages, files that use a long file name also have a standard file name alias that is automatically assigned to it. This is often referred to as a short file name in order to distinguish it from a long file name. This process of adding an alias is performed by truncating and modifying the file name.

Let's take a quick look at an example to see how this works. You're working in Windows® 9x and have just created a Word document that is your proposed budget for the coming year.

You save this document as: Proposed Budget for 2003.DOC

Windows® will save this document exactly as you named it, however the alias naming convention will cause this document to be saved as PROPOS~1.DOC.

Taking this a step further, let's say you create an amended budget, and name that file: Proposed Budget for 2003 As Amended.DOC. Note, that except for the addition of " As Amended", the file name in the beginning is identical to your first one.

When the alias routine reads the first six characters, appends the ~1 to the file and then attempts to save it, it will see that a file already exists. Windows® will then append a ~2" to the file and attempt to save it again. If successful, your alias file will look like: PROPOS~2.DOC.

By doing this, Microsoft has solved the problem of "ease of use" as well as making the files available to older software by allowing the reference to the file using the older 8.3 naming convention. Even the use of spaces in long file names is permitted, and doing so doesn't cause any problems as applications designed for Windows® 95 are aware of their use, and because the short file name alias has the spaces removed.

Now that you have some idea of how Microsoft conquered the "ease of use" and "compatibility" issues, let's take a look at what they did to be able to store and retrieve these files through various applications. While files using the long file name conventions are stored in regular directories using standard directory entries, there are a few other issues that were dealt with. The Window® 95 file system creates a standard directory entry for the "long file name" file, into which it puts the short file name alias. It then creates several additional directory entries to hold the rest of the long file name. This is important to understand, as a single long file name can use (or create) quite a few directory entries, as each entry is only 32 bytes in length. It is, for this reason, recommended that long file names not be placed in the root directory of a VFAT partition, as the total number of directory entries in the root is limited.

The FAT 32 file system removes this root restriction, however limiting the number of "long file name" files you place in the root of a partition is still good practice!

In order to ensure that pre-Windows® software versions aren't confused by this change in directory use, each of the extra directory entries used to hold the long file name information are tagged with the an odd combination of file attributes. Odd in the sense that they really didn't exist on the same scale as they did after the release of Windows® 95 and MS-DOS® 7.x.

This will ensure that older versions of MS-DOS® will not try to do anything with these long file name entries, including not overwriting them because it thinks they are not being used. This combination of file attributes causes older software to ignore the extra directory entries being used by VFAT as this combination of file attributes had no valid meaning in earlier coding.

Microsoft is often criticized for the way in which the improved the usability of Windows® 95 while remaining compatible with old software kind of shows. Their development of VFAT is often referred to as a hack built on top of the standard FAT file system. As with any software change, there are numerous problems that arise, and below are some of those that involve long file names that we felt you should be aware of:

File Names and their Extensions
As your are probably already aware, DOS-based computer files are named using a fixed 8.3 format convention that has been in use since IBM's release of the first personal computer. This file naming conventions is comprised of two parts:

File extensions are often the cause of confusion, and hopefully the following will clear up some of this. Most of today's operating systems, especially Windows®, rely upon file extensions in order to do two things, associate a specific file or group of files with a given program, if not the operating system itself, as well as determine what to do with a specific file in the event some form of command is executed that calls a specific file. Confused yet?

Normally, a file extension lets you, but more importantly lets the operating system, in a simplistic way, know what type of file it is looking at. As an example, most .com, .bat and .exe files are operating system or program related. In all cases, .exe files are executables crafted to perform a specific function. Likewise, .jpg, .bmp, .psd and .psp for example, are all normally graphic related files. If you were working only in DOS environment, many of the file names used today would be meaningless to that operating system. DOS has no idea what an .htm, .jpg, .bmp, .psd or .psp is. On the other hand, DOS knows exactly how to handle files with extensions that were written as part of its original source code, such as .exe, .com, .bat etcetera.

Windows®, on the other hand, needs the file extensions to both organize files as well as associate them with the programs that require them. You can put this importance to the test by trying to change a file extension. Windows will waste no time in warning you that doing so may render the file useless, or damage the program that requires the file you're trying to change.

Prior to the release of Windows®, there were but a few file extensions to worry about, and no one gave any thought to standards or consistency. Today, after the release of several versions of Windows®, using consistent file extensions is important. Windows® maintains a list of extensions and their file associations, which guides Windows as to what needs to be done when you double-click on a specific file types. Windows® will automatically launch the program that it associates with the file you select, and then tell the program to open the file you selected. Windows® does not examine the content of the file when it launches what it perceives as the associated program. It merely looks at the file extension!

Although we would like to think otherwise at times, Windows® is not perfect when selecting which program to open when you double-click on a file. Sometimes there are wrong program file extension associations, and even those occasions when the association is missing entirely. This is why Windows® will permit you to add or change a file association. If the file extension is unknown to Windows (for what ever reason), it will ask you which program you would like to use to open it.

The following characters are permitted as part of the DOS file naming convention: A-Z 0-9 $ % ' - _ @ ~ ` ! ( ) ^ # &. Although a blank space is a valid character, we recommend that you not use it as many programs, including Windows®, become confused by file names that contain blank spaces in them. Microsoft specifically recommends that you avoid this practice in Windows® 9x/ME because of the 8.3 alias for long file names.

Notice: Windows® 95, Windows® 98, Windows® NT, Windows® 2000, Windows® XP and
Microsoft® Office are registered trademarks or trademarks of the Microsoft Corporation.
All other trademarks are the property of their respective owners.

Copyright ©1995-2003 DEW Associates Corporation. All rights reserved.