Each network file has directory information associated with it which is stored in the server’s Directory Entry Table (DET).
A file’s directory information consists of the file’s size, attributes, creation date, date of last access, date and time the file was last modified, and the date and time the file was last archived. It also includes the owner’s object ID, object IDs of up to 6 trustees, trustee rights mask for up to 6 trustees, Inherited Rights Mask, etc:
The file attributes contains the information obtained by the NetWare® FLAG utility: read-only versus read/write, sharable versus nonsharable, etc.
A file’s directory information can be set by calling SetFileInfo. In addition, GetExtendedFileAttributes and SetExtendedFileAttributes respectively obtain and set a part of a file’s attributes called extended file attributes.
An application can call SetFileInfo to set specific file information such as
creationDateAndTime—Creation date of the file (DOS format; 4 bytes)
fileAttributes—File attributes to be assigned to the file
fileOwnerID—Unique Bindery object ID of the file’s owner (the name and Bindery object type of the file owner can be obtained by calling NWGetObjectName (NDK: Bindery Management).
lastArchiveDateAndTime—Last archived date and time of the file (DOS format; 4 bytes)
lastUpdateDateAndTime—Last update date and time of the file (DOS format; 4 bytes).
The creationDateAndTime, lastAccessDate, lastArchiveDateAndTime, and lastUpdateDateAndTime parameters require a little interpretation. _ConvertTimeToDOS and _ConvertDOSTimeToCalendar can be used to manipulate DOS times.
The creationDateAndTime parameter consists of 4 bytes indicating the hour, minute, second, year, month, and day that the file was created.
The lastAccessDate parameter consists of 2 bytes indicating the year, month, and day that the file was last accessed.
The lastUpdateDateAndTime and lastArchiveDateAndTime parameters consist of 4 bytes indicating the hour, minute, second, year, month, and day that the file was last modified or archived, respectively. The first 2 bytes of each parameter contain the year, month, and day fields, the same as the lastAccessDate parameter. The hour, minute, and second fields are in the second 2 bytes of each parameter:
The following figure illustrates which byte contains which element of the date and time information.
Figure 8-1 Date and Time Format
The file attributes are contained in a 4-byte field within the file’s directory entry stored in the volume’s DET. The attributes bytes (bytes 0 to 3) consist of flag bits whose settings can be modified.
The low-order file attribute byte contains flag bits similar to the DOS attribute byte. A client must have Modify rights to change the setting of bits in the file attribute bytes.
When set, the bits in the low-order attribute byte (byte 0) have the following meanings:
The following table gives the attribute bits that are set for each possible mode setting (the _A constants are defined in DIRECT.H):
The access and chmod functions indirectly work on the attributes in byte 0. The attribute bits in this byte are used to emulate what is called the mode of the file under UNIX.
The GetExtendedFileAttributes and SetExtendedFileAttributes functions obtain and set the second file attribute byte (byte 1) by passing a file path and extended file attributes byte.
The bits in byte 1 have the following meanings:
The Index file attribute is no longer supported since all the files are automatically indexed when they have 64 or more regular File Allocation Table (FAT) entries and are randomly accessed.
The following bits are defined for byte 2:
NetWare 4.x, 5.x, and 6.x also definethe following attributes in byte 3:
To record information about directories and files, a server maintains a Directory Entry Table (DET). The DET consists of several types of 128-byte entries, including directory nodes, file nodes, and trustee nodes.
A directory node includes the following information about a directory: directory name, attributes, inherited rights mask, creation date and time, creator’s object ID, a link to the parent directory, and a link to a trustee node (if one exists). It also includes a name space indicator, last archived date and time, last modification date and time, up to 8 trustee object IDs, up to 8 trustee rights masks.
A file node includes the following information about a file: filename, attributes, file size, creation date and time, deletion date and time, owner’s object ID, object ID of the object that performed the last deletion, object IDs of up to 6 trustees, trustee rights mask for up to 6 trustees, inherited rights mask, last-accessed date, last-updated date and time, and a link to a directory.
A trustee node includes the following information: the object IDs of 2 to 16 trustees of a directory linked to the trustee node, 2 to 16 corresponding trustee rights masks, a link to a directory, and a link to the next trustee node (if one exists).
To record information about volumes, a server maintains a Volume Table that includes the number of volumes mounted in the server, the name, size, and other information pertaining to each volume. Functions that return information about volumes access the Volume Table.