Information Technology Reference
In-Depth Information
3. Truncate the name portion (before the dot) to six characters.
4. If there is an extension, truncate it to three characters.
5. Convert all characters from Unicode to ANSI or another 8-bit character
set.
6. Convert all characters to upper case.
7. Convert any illegal 8.3 characters to underscores (_).
8. The seventh character is a tilde (~).
9. Set the eighth character to the lowest number that results in a unique file
name, beginning with 1.
For example, the long file name johnsmith.txt becomes JOHNSM~1.TXT,
and the long file name johnsmythe.txt in the same directory becomes
JOHNSM~2.TXT. If the number following the ~ is greater than 9, the
name preceding the ~ must be truncated further to enable creating a unique
short file name. When five or more names have the same initial characters
and extensions, Windows XP Professional uses a slightly different method to
create the short file names.
Using Directories
Device firmware that supports a file system must be able to read information
from directory entries and create and update directory entries when a file is
created or written to. The code that follows performs these functions.
Storing an Entry
A DIRENTRY structure can store a directory entry's 32 bytes:
#define DIR_NAMESIZE 8
#define DIR_EXTENSION 3
#define NULL 0
#define FALSE 0
#define TRUE !FALSE
Search WWH ::




Custom Search