20.3 NKS Flags

The following flags are used by the NKS functions and structures:

20.3.1 Change Bits for Files and Directories

The change bit flags are used to control which metadata of a file or directory is updated.They are used by the NXSetAttr and NXSetAttrWithHandle functions, and they are defined in the nks/dirio.h file.

Change Bit Flags and Value

Value

Description

NX_DIRENT_EFFECTIVERIGHTS

0x0000000000000001

Refers to the generic portion of the structure and is currently unsupported.

NX_DIRENT_FLAGS

0x0000000000000002

Refers to the extended buffer structure and is currently unsupported.

NX_DIRENT_OWNERID

0x0000000000000004

Changes the object owner's identity (deOwnerId) and is currently unsupported.

NX_DIRENT_CREATETIME

0x0000000000000008

Changes the creation time. This is not supported if the level is NX_DELEVEL_BASIC.

NX_DIRENT_CHANGETIME

0x0000000000000010

Changes the time of last modification to attributes and is currently unsupported.

NX_DIRENT_ACCESSTIME

0x0000000000000020

Changes the time of last modification to data.

NX_DIRENT_MODIFYTIME

0x0000000000000040

Changes the time of last modification to both data and attributes.

NX_DIRENT_ATTRIBUTES

0x0000000000000080

Changes the entry's attributes. This is not supported if the level is NX_DELEVEL_BASIC.

NX_DIRENT_RESERVED1

0x0000000000000100

Reserved to NX_DELEVEL_BASIC.

NX_DIRENT_RESERVED2

0x0000000000000200

Reserved to NX_DELEVEL_BASIC.

NX_DIRENT_RESERVED3

0x0000000000000400

Reserved to NX_DELEVEL_BASIC.

NX_DIRENT_RESERVED4

0x0000000000000800

Reserved to NX_DELEVEL_BASIC.

Beyond this point, the extended level structures may define their own bits.

20.3.2 Effective Rights Flags

The following flags are ORed together to form a bit mask of a user's effective rights to a file or directory. These flags are defined in the nks/dirio.h file.

Flag

Value

Description

NX_READ_EXISTING_FILE

0x00000001

Grants the trustee the ability to open and read the file or folder and any subordinate items. This includes the ability to execute program files.

NX_WRITE_EXISTING_FILE

0x00000002

Grants the trustee the ability to open and write to (modify) the file or folder and any subordinate items.

NX_CREATE_NEW_ENTRY

0x00000008

Grants the trustee the ability to create new items and salvage deleted items in the folder and any subfolders.

NX_DELETE_EXISTING_ENTRY

0x00000010

Grants the trustee the ability to delete the file or folder and any subordinate items.

NX_CHANGE_ACCESS_CONTROL

0x00000020

Grants the trustee the ability to change the trustee (rights) assignments and inherited rights filter of the file or folder.

NX_SEE_FILES

0x00000040

Grants the trustee the ability to see (in a listing or browser) the file or folder and any subordinate items, including its path back to the root of the volume.

NX_MODIFY_ENTRY

0x00000080

Grants the trustee the ability to change the name and attributes of the file or folder and any subordinate items. The trustee can’t see or modify the actual contents of files.

NX_SUPERVISOR_PRIVELEGES

0x00000100

Grants the trustee all rights to the file or folder and any subordinate items. This right can’t be filtered (blocked) on the current file or folder or on subordinate items, nor can it be revoked on individual subordinate items.

NX_ACCESS_RIGHTS_MASK

0x000001FB

Makes the rights to the selected property flow to all objects below.

20.3.3 File Range Lock Flags

The NXFileRangeLock function and the NXFileRangeLockSpec_t structure use following flags:

Flag

Value

Description

NX_RANGE_LOCK_SHARED

0x00000001

Requests a shared lock. When this lock is in effect, subsequent shared lock requests will be granted for the specified range.

If not ORed with the NX_RANGE_LOCK_TRYLOCK flag, blocks until the lock is available.

NX_RANGE_LOCK_EXCL

0x00000002

Requests an exclusive lock. When this lock is in effect, no subsequent shared or exclusive lock requests will be granted for the specified range.

If not ORed with the NX_RANGE_LOCK_TRYLOCK flag, blocks until the lock is available.

These flags, listed above, can be ORed with one of the following flags.

Flag

Value

Description

NX_RANGE_LOCK_TRYLOCK

0x00000008

When the lock is not available, returns failure immediately without blocking.

NX_RANGE_LOCK_CHECK

0x00000004

Determines whether a lock of the requested type can be acquired. The requested lock is not actually acquired.

20.3.4 File State Flags

The NXDirAttr_t structure uses the following flags to return information about a directory entry. The flags can be ORed together, and they are defined in the nks/dirio.h file.

Flag

Value

Description

NX_DEFLAGS_COMPRESSED

0x00000001

Entry is in a compressed state.

NX_DEFLAGS_ENCRYPTED

0x00000002

Entry is encrypted.

NX_DEFLAGS_TEMPORARY

0x00000004

Entry is a temporary file.

NX_DEFLAGS_MIGRATED

0x00000008

Entry has been migrated.

NX_DEFLAGS_DELETED

0x00000010

Entry is marked for deletion.

NX_DEFLAGS_SPARSE

0x00000020

Entry is a sparse file.

20.3.5 NetWare Attributes

Directory and file attributes assign properties to individual directories or files. Some attributes are meaningful only when applied at the file level, but some apply to both the directory and the file levels. Attributes apply to all users. These attribute flags are defined in the fsio.h file.

Flag

Value

Description

ATTR_NORMAL

0x00000000

Indicates the Read/Write attribute is assigned and the Shareable attribute is not. This is the default attribute assignment for all new files.

ATTR_READ_ONLY

0x00000001

Prevents a file from being modified. This attribute automatically sets Delete Inhibit and Rename Inhibit.

ATTR_HIDDEN

0x00000002

Hides directories and files so they cannot be listed using the DIR command.

ATTR_SYSTEM

0x00000004

Hides the directory or file so it cannot be seen by using the DIR command. System is normally used with operating system files, such as DOS system files.

ATTR_EXECUTE

0x00000008

Prevents the file from being copied, modified, or backed up. It does allow renaming. The only way to remove this attribute is to delete the file. Use the attribute for program files such as .exe or .com.

ATTR_VOLUME_ID

0x00000008

ATTR_DIRECTORY

0x00000010

Indicates the entry is a subdirectory.

ATTR_ARCHIVE

0x00000020

Identifies files that have been modified since the last backup. This attribute is assigned automatically.

ATTR_SHARE

0x00000080

Allows more than one user to access the file at the same time. This attribute is usually used with Read Only.

ATTR_NO_SUBALLOC

0x00000800

Prevents data from being suballocated.

ATTR_TRANS

0x00001000

Allows a file to be tracked and protected by the Transaction Tracking System™ (TTS™).

ATTR_READAUD

0x00004000

Indicates the file is audited for reading.

ATTR_WRITAUD

0x00008000

Indicates the file is audited for writing.

ATTR_IMMPURG

0x00010000

Flags a directory or file to be erased from the system as soon as it is deleted. Purged directories and files cannot be recovered.

ATTR_NORENAM

0x00020000

Prevents the directory or file name from being modified.

ATTR_NODELET

0x00040000

Prevents a directory or file from being deleted. This attribute overrides the Erase trustee right.

ATTR_NOCOPY

0x00080000

Prevents Macintosh users from copying a file. This attribute overrides Read and File Scan trustee rights.

ATTR_FILE_MIGRATED

0x00400000

Indicates that the file has been migrated.

ATTR_DONT_MIGRATE

0x00800000

Prevents directories and files from being migrated from the server’s server disk to another storage medium.

ATTR_IMMEDIATE_COMPRESS

0x02000000

Sets data to be compressed as soon as a file is closed. If applied to a directory, every file in the directory is compressed as each file is closed.

ATTR_FILE_COMPRESSED

0x04000000

Indicates that the file has been compressed.

ATTR_DONT_COMPRESS

0x08000000

Keeps data from being compressed. This attribute overrides settings for automatic compression of files not accessed within a specified number of days.

ATTR_CANT_COMPRESS

0x20000000

Indicates that the file cannot be compressed.

ATTR_ATTR_ARCHIVE

0x40000000

Indicates the file has been modified.

20.3.6 NKS Open Modes

Consoles, files, and FIFOs use the following open modes, and they are used by functions such as NXFileOpen, NXDeviceOpen, and NXIoGetOpenMode and the NXFileOpenSpec_t structure. Exactly one of the first three access flags in the following table can be set.

Flag

Value

Description

NX_O_RDONLY

0x00000000

Open the object for read only.

NX_O_WRONLY

0x00000001

Open the object for write only.

NX_O_RDWR

0x00000002

Open the object for both reading and writing. This flag cannot be used with a FIFO.

NX_O_ACCMODE

0x00000003

Specifies the access flags mask. You use this mask to isolate the read and write mode of the file by ANDing this mask to one of the three previous flags (NX_O_RDONLY, NX_O_WRONLY, or NX_O_RDWR). When this flag is present, operation flags have no effect when ORed to the mask.

Operation flags can be ORed to the access flags, depending upon the type of device:

FIFOs

For FIFOs, the following flag can be ORed to a flag in the first set.

Flag

Value

Description

NX_O_NONBLOCK

0x00000400

Opens the object in a non-blocking mode.

Consoles

For consoles, the following flag can be ORed to a flag in the first set.

Flag

Value

Description

NX_O_NONBLOCK

0x00000400

Opens the object in a non-blocking mode.

NX_O_SCROLLABLE

0x00000800

Opens the console in a scrollable screen.

Files

For files, the following operation flags can be ORed to a flag in the access set.

Flag

Value

Description

NX_O_ACCOMDE

0x00000003

Specifies the access flags mask. You use this mask to isolate the read and write mode of the file by ANDing this mask to one of the three previous flags (O_RDONLY, O_WRONLY, or O_RDWR).

NX_O_APPEND

0x00000010

Causes each record that is written to be written at the end of the file.

NX_O_CREAT NX_O_CREATE

0x00000020

Creates the file if it does not already exist.

  • If NX_O_EXCL is present, the file must not exist. If it does, the open fails.

  • If NX_O_EXCL is not present and the file exists, opens the file.

NX_O_TRUNC NX_O_TRUNCATE

0x00000040

If the file already exists and the mode is not NX_O_RDONLY, the file is overwritten to become a zero length file.

NX_O_EXCL NX_O_EXCLUSIVE

0x00000080

Used in combination with NX_O_CREAT. If the file already exists, the open fails.

NX_O_TRANS

0x00000100

Not used.

NX_O_OPMODE

0x000005E0

Specifies the operations mask. You use this mask to limit the value to operation flags. When this flag is present, access flags have no effect when ORed to the mask. You AND this mask to one of the operation flags in this table.

20.3.7 NXDeLevel_t Enumeration

A number of functions (NXDirEnumStart, NXGetAttr, NXSetAttr, etc.) and the NXDeHeader_t structure use the following flags to set the amount of file system information to access.

Flag

Value

Description

NX_DELEVEL_BASIC

0x7FFFFFFF

Basic attribute information common to all pathname formats

NX_DELEVEL_NAME_ONLY

0x80000000

Filename only. The buffer parameter should point to a NXDirAttrWithName_t structure.

NX_DELEVEL_EXTENDED

0x80000001

Extended file system information

20.3.8 NXObjType_t Enumeration

The NXDeHeader_t, NXNameSpec_t, and NXStreamSpec_t structures use the following flags to specify the object type.

Flag

Value

Description

NX_OBJ_UNKOWN

0xFFFFFFFF

Unknown object.

NX_OBJ_DEFAULT

0xFFFFFFFE

For NKS internal use only.

NX_OBJ_FILE

0xFFFFFFFD

File entry only.

NX_OBJ_DIR

0xFFFFFFFC

Directory entry only.

NX_OBJ_FIFO

0xFFFFFFFB

Entry in the FIFO naming space (implementation dependent).

NX_OBJ_DEVICE

0xFFFFFFFA

Entry in the device naming space (implementation dependent).

NX_OBJ_CONSOLE

0xFFFFFFF9

Screen and keyboard entry.

NX_OBJ_SYMLINK

0xFFFFFFF8

Symbolic link entry.

20.3.9 NXPathFormat_t Enumeration

These values specify the name and path format for files or directories. They are defined in the nks/dirio.h file and are used by such structures as NXDeHeader_t and such functions as NXGetAttrWithHandle. NXPathFormat_t enumerates the following values:

Constant

Value

Description

NX_PNF_NKS

0

NKS name space, which is currently used for Windows clients and traditional and NSS volumes.

NX_PNF_DOS

1

8.3 or DOS format.

NX_PNF_MAC

2

Macintosh format (255-character names).

NX_PNF_UNIX

4

UNIX format (256-character names).

NX_PNF_WIN

5

Windows (NT) format (255-character names). Not currently implemented.

NX_PNF_NSS

7

Novell® Storage Services (255-character names). Not currently implemented.

20.3.10 Shared Modes

The NXFileOpen function, the NXDeviceOpen function, and the NXFileOpenSpec_t structure use following flags:

Flag

Value

Description

NX_SHARE_DENYNO

0x00000000

Deny none, which allows reading and writing

NX_SHARE_DENYRD

0x00100000

Deny reading

NX_SHARE_DENYWR

0x00200000

Deny writing

NX_SHARE_DENYALL

0x00400000

Deny reading and writing

NX_SHARE_MASK

0x00700000

Used to retrieve the file's setting for the shared mask.