NXSetAttrWithHandle

Sets the attributes of a file or directory.

Library:LibC
Classification:NKS
Service:File and Directory I/O

Syntax

  #include <nks/dirio.h> 
  
  int NXSetAttrWithHandle (
     NXHandle_t        handle, 
     NXPathFormat_t    format, 
     NXDeLevel_t       level,
     const void       *buffer,
     NXChangeBits_t    changeBits);
  

Parameters

handle

(IN) Specifies a handle to a previously opened file.

format

(IN) Specifies the pathname format of the file. See NXPathFormat_t Enumeration.

level

(IN) Specifies the level of information to set (see NXDeLevel_t Enumeration).

buffer

(IN) Points to a buffer where information can be found to change for the specific file system object (as defined by the individual platform). This value can be NULL. If a bit in changeBits corresponds to a changeable attribute in the extended entry information, this buffer is expected both to exist and to be long enough to safely satisfy access to changed field. To allow for future platform-specific extensions, the contents are expected to be interpreted in a platform- local file system-dependent manner.

changeBits

(IN) Specifies the fields that are to change. See Change Bits for Files and Directories.

Return Values

If successful, returns 0. Otherwise, returns one of the following error codes:

Decimal

Hex

Constant

Description

4

0x04

NX_EBADF

Invalid handle.

6

0x06

NX_EACCES

Insufficient rights to the object.

9

0x09

NX_EINVAL

The changeBits parameter contains an unsupported value.

24

0x18

NX_EAGAIN

Resource exhaustion prevented successful completion.

79

0x4F

NX_ENOTSUP

The operation is not supported.

105

0x69

NX_ENOCONTEXT

The calling thread has no NKS context.

Remarks

NXSetAttrWithHandle changes the information of the open object identified by the handle. For more information about the levels and the structures, see NXGetAttrWithHandle.

The length of the structure is implicit because the structure is determined by the pathname format of pathCtx and the attribute structures (NXDirAttr_t and others) are fixed length.

The NXSetAttrWithHandle function does not support the NX_DELEVEL_NAME_ONLY flag. Instead, use the NXRename function.

See Also