Sets the attributes of a file or directory.
#include <nks/dirio.h> int NXSetAttr ( NXPathCtx_t pathCtx, const void *pathname, NXDeLevel_t level, const void *buffer, NXChangeBits_t changeBits);
(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.
(IN) Points to the name (without wildcards) of the file or directory.
(IN) Specifies the level of information to set (see NXDeLevel_t Enumeration).
(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.
(IN) Specifies the fields that are to change (corresponding to the fields described in buffer). See Change Bits for Files and Directories.
If successful, returns 0. Otherwise, returns one of the following error codes:
NXSetAttr 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 NXGetAttr.
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 pathname format of pathCtx and the attribute structures (NXDirAttr_t and others) are fixed length.
The NXSetAttr function does not support the NX_DELEVEL_NAME_ONLY flag. Instead, use the NXRename function.