2.3.1 Directory Entry Fields

Status
Contains information specifying the type of structure this is. It also contains the status of the pointers in the structure and the status of the attributes, time, date, and name.

Bit

Definition

0

Exists
1 Exists
0 Deleted

1

ATDFields
1 ATD fields are most recent
0 ATD fields are superseded

3-2

StructType
00 DirEntry structure

4

FNULLBits
0 PrimaryPtr valid
1 PrimaryPtr is FNULL

5

0 SecondaryPtr valid
1 SecondaryPtr is FNULL

6

0 SiblingPtr valid
1 SiblingPtr is FNULL

15-7

Reserved
Must be 1s.


Exists
Indicates whether or not the entry under consideration is a valid member of the directory hierarchy. The bit is cleared when a directory has been deleted. Deleted entry information should be ignored. However, if the SiblingPtr is not FNULL, then it is still valid and is used in traversing a sibling chain.

ATDFields
Indicates whether or not the Attributes/Time/Date fields in this structure are the most current for this directory. The first valid structure in the DirEntry chain to have this bit set has valid information, all others should be ignored. This bit only affects the validity of these fields.

StructType
Indicates that this structure is a directory entry.

FNULLBits
Indicate whether the corresponding pointer is to be considered to have a value of FNULL, regardless of the actual value of the pointer. The FNULL bits are cleared only after their respective pointers are assigned values by the file system. Therefore, the FNULL bits are the first check for validity of these pointers. These bits provide yet another fail-safe measure to guarantee file system integrity in the event of a system crash while updating these pointers.

SiblingPtr
A pointer to the next sibling directory or file at the same level in the hierarchy as the present directory. This pointer is only valid if the SecondaryPtr is FNULL (or considered to have a value of FNULL as indicated by the FNULL bits). A pointer value of FNULL, or one that is considered to have a value of FNULL as indicated by the FNULL bits, indicates the last entry in the chain.

PrimaryPtr
A pointer to the present directory's children which may be other directories or files. The PrimaryPtr is used to locate the next entry in the DirEntry chain only if PrimaryPtr is not FNULL (and not considered to have a value of FNULL as indicated by the FNULL bits) and SecondaryPtr is FNULL (or considered to have a value of FNULL as indicated by the FNULL bits). If both PrimaryPtr and SecondaryPtr are FNULL (or considered to have values of FNULL as indicated by the FNULL bits), then the end of the chain has been reached.

SecondaryPtr
A pointer to a DirEntry which supersedes the current DirEntry. The SecondaryPtr is used to indicate that a DirEntry structure has been completely superseded. In this case SecondaryPtr is the only pointer field in the DirEntry structure that is valid.

Attribute
Directory creation attributes in MS-DOS format.

Bit

Definition

0

1 READONLY file

1

1 HIDDEN file or directory

2

1 SYSTEM file or directory

3

1 VOLUME label

4

1 DIRECTORY

0 FILE

5

1 ARCHIVE

7-6

Reserved

Must be 0's.


Time
Directory creation time in MS-DOS format.

Bit

Definition

4-0

Binary number of 2 second increments (0-29, corresponding to 0-58 seconds).

10-5

Binary number of minutes (0-59).

15-11

Binary number of hours (0-23).


Date
Directory creation date in MS-DOS format.

Bit

Definition

4-0

Day of month (1-31)

8-5

Month (1-12)

15-9

Year (relative to 1980)


VarStuctLen
The sum total length, in bytes, of all the variable length structures appended after the end of the members of the DirEntry structure. This field is zero, indicating that none of these structures is present.

NameLen
The length, in bytes, of the following combined directory name and extension fields. This field is added for the purpose of adding long file names in a future version of the file system.

Name[8]
Directory name in MS-DOS format. Names are left-justified and padded with blanks (20h). Valid characters, as defined by MS-DOS for the 8.3 names, are any combination of letters, digits and the following special characters:

$ % - _ ~ ! ( ) { } ^ # &

FFS does not distinguish between uppercase and lowercase letters.

Ext[3]
Directory extension in MS-DOS format. Names are left-justified and padded with blanks (20h). Valid characters, as defined by MS-DOS for the 8.3 names, are any combination of letters, digits and the following special characters:

$ % - _ ~ ! ( ) { } ^ # &

FFS does not distinguish between uppercase and lowercase letters.

Figure 3

Figure 3 depicts how each pointer type within a DirEntry is related to all valid subsequent structures.