8.9 NLM File Information

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

The creationDateAndTime, lastAccessDate, lastArchiveDateAndTime, and lastUpdateDateAndTime parameters require a little interpretation. _ConvertTimeToDOS and _ConvertDOSTimeToCalendar can be used to manipulate DOS times.

The following figure illustrates which byte contains which element of the date and time information.

Figure 8-1 Date and Time Format

8.9.1 File Attributes

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):

Mode

Attributes

None

_A_EXECUTE

_A_NODELET

_A_NORENAM

_A_SYSTEM

R

_A_RDONLY

_A_NODELET

_A_NORENAM

 

W

_A_HIDDEN

_A_NODELET

_A_NORENAM

 

X

_A_EXECUTE

 

 

 

RW

None

 

 

 

RX

_A_RDONLY

_A_NODELET

_A_NORENAM

 

WX

_A_HIDDEN

_A_NODELET

_A_NORENAM

 

RWX

None

 

 

 

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.

8.9.2 Extended File Attributes

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:

8.9.3 Directory Entry Table

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).

8.9.4 Volume Table

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.