Directory Table
A directory table is a special type of file that represents a directory. Each file or directory stored within it is represented by a 32-byte entry in the table. Each entry records the name, extension, attributes (archive, directory, hidden, read-only, system and volume), the date and time of creation, the address of the first cluster of the file/directory's data and finally the size of the file/directory.
Legal characters for DOS filenames include the following:
- Upper case letters A–Z
- Numbers 0–9
- Space (though trailing spaces in either the base name or the extension are considered to be padding and not a part of the filename, also filenames with spaces in them could not be used on the DOS command line because it lacked a suitable escaping system)
- ! # $ % & ' ( ) - @ ^ _ ` { } ~
- Values 128–255
This excludes the following ASCII characters:
- " * / : < > ? \ |
Windows/MS-DOS has no shell escape character - Lower case letters a–z
stored as A–Z on FAT12/FAT16 - Control characters 0–31
- Value 127 (DEL)
Code 0xE5 as the first byte (see below) makes troubles when Cyrillic KOI8 encoding is used, because it corresponds to Cyrillic capital letter "Е". Some operating systems such as ANDOS used to automatically change the letter to the similar-looking Latin one.
The DOS filenames are in the OEM character set.
Directory entries, both in the Root Directory Region and in subdirectories, are of the following format:
Byte Offset | Length | Description | |||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0x00 | 8 | DOS filename (padded with spaces)
The first byte can have the following special values:
|
|||||||||||||||||||||||||||
0x08 | 3 | DOS file extension (padded with spaces) | |||||||||||||||||||||||||||
0x0b | 1 | File Attributes
The first byte can have the following special values:
An attribute value of 0x0F is used to designate a long filename entry. |
|||||||||||||||||||||||||||
0x0c | 1 | Reserved; two bits are used by NT and later versions to encode case information | |||||||||||||||||||||||||||
0x0d | 1 | Create time, fine resolution: 10ms units, values from 0 to 199. | |||||||||||||||||||||||||||
0x0e | 2 | Create time. The hour, minute and second are encoded according to the following bitmap:
Note that the seconds is recorded only to a 2 second resolution. Finer resolution for file creation is found at offset 0x0d. |
|||||||||||||||||||||||||||
0x10 | 2 | Create date. The year, month and day are encoded according to the following bitmap:
|
|||||||||||||||||||||||||||
0x12 | 2 | Last access date; see offset 0x10 for description. | |||||||||||||||||||||||||||
0x14 | 2 | EA-Index (used by OS/2 and NT) in FAT12 and FAT16, High 2 bytes of first cluster number in FAT32 | |||||||||||||||||||||||||||
0x16 | 2 | Last modified time; see offset 0x0e for description. | |||||||||||||||||||||||||||
0x18 | 2 | Last modified date; see offset 0x10 for description. | |||||||||||||||||||||||||||
0x1a | 2 | First cluster in FAT12 and FAT16. Low 2 bytes of first cluster in FAT32. | |||||||||||||||||||||||||||
0x1c | 4 | File size |
Read more about this topic: 8.3 Filename
Famous quotes containing the words directory and/or table:
“Although then a printer by trade, he listed himself in this early directory as an antiquarian. When he was asked the reason for this he replied that he always thought every town should have at least one antiquarian, and since none appeared for the post, he volunteered.”
—For the State of Iowa, U.S. public relief program (1935-1943)
“Many a time I have seen my mother leap up from the dinner table to engage the swarming flies with an improvised punkah, and heard her rejoice and give humble thanks simultaneously that Baltimore was not the sinkhole that Washington was.”
—H.L. (Henry Lewis)