NXSetAttrWithPnf

Sets the attributes of a file or directory.

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

Syntax

  #include <nks/dirio.h> 
  
  int NXSetAttrWithPnf (
     NXPathCtx_t      pathCtx,
     const void      *pathname,
     NXPathFormat_t   pnf,
     NXDeLevel_t      level,
     const void      *buffer,
     NXChangeBits_t   changeBits);
  

Parameters

pathCtx

(IN) Points to the file system path context of the file or directory. Along with the pathname parameter, it specifies the file or directory whose attributes you are changing.

pathname

(IN) Points to the name (without wildcards) of the file or directory.

pnf

(IN) Specifies the name space to use when setting the information (see NXPathFormat_t Enumeration). This value overrides the value implied by the pathCtx parameter.

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 (corresponding to the fields described in buffer). 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

1

0x01

NX_ENOENT

Either pathCtx or pathname do not identify an existing object.

4

0x04

NX_EBADF

Invalid path context.

6

0x06

NX_EACCES

Insufficient rights to the object.

9

0x09

NX_EINVAL

Either pathCtx was specified and pathname indicates a full path or changeBits contains an unsupported value.

24

0x18

NX_EAGAIN

Resource exhaustion prevented successful completion.

65

0x41

NX_ENAMETOOLONG

pathname is longer than system-permitted name lengths.

79

0x4F

NX_NOTSUP

The operation is not supported.

105

0x69

NX_ENOCONTEXT

The calling thread has no NKS context.

Remarks

NXSetAttrWithPnf modifies one or more attributes of a file or directory entry identified by pathCtx and pathname. For more information about the levels and the structures, see NXGetAttrWithPnf.

Please consult the header or other documentation in determining what attributes of an entry are subject to modification.

The length of the structure is implicit because the structure is determined by the pnf parameter, and the attribute structures (NXDirAttr_t and others) are fixed length.

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

See Also