Is a macro that creates a new file or truncates an existing file by calling NXFileOpen.
#include <nks/fsio.h> int NXFileCreate ( NXPathCtx_t pathCtx, const void *pathname, NXHandle_t *fileHandle);
(IN) Specifies a file system path context. Along with the pathname parameter, it specifies the file to create.
(IN) Points to a null-terminated Unicode or ASCII string that specifies the name of the file to create or rewrite. If a file by the same name already exists under the directory specified by the pathCtx parameter and the caller has rights to delete the file, the existing file is deleted and a new file with the same name is created.
(OUT) Points to the returned open file descriptor that is associated with the created file on success. On failure, returns a -1.
If successful, returns an open file descriptor. Otherwise, returns an error code.
NXFileCreate creates a new file by rewriting NXFileOpen. NXFileCreate is equivalent to:
createFlags = NX_O_WRONLY | NX_O_CREAT | NX_O_TRUNC; NXFileOpen (pathCtx, pathname, createFlags, &fileHandle);
The file is opened for write only and with the default share mode of NX_SHARE_DENYNO (unless you call NXFileOpenEx).
If a previous file exists by the same name, it is possible that the previous file that was slated to be overwritten might be destroyed if NXFileCreate returns with a failure.