Opens the specified file (simplified interface).
#include <nks/fsio.h> int NXFileOpen ( NXPathCtx_t pathCtx, const void *pathname, NXMode_t mode, NXHandle_t *fileHandle);
(IN) Specifies the file system path context. Along with the pathname parameter, it specifies the file to open.
(IN) Points to a null-terminated Unicode or ASCII string that specifies the name of the file (relative to pathCtx) to open or create.
(IN) Specifies if the file is to be opened for reading, writing, or both. See NKS Open Modes.
(OUT) Points to an integer-valued open file descriptor on success. On failure, returns -1.
If successful, returns 0 and an open file descriptor in the fileHandle parameter. Otherwise, returns an error code. On failure the new file remains unopened. However, if the request was overwrite a file and NXFileOpen fails, the file might be destroyed in the process.
NXFileOpen creates a file handle and associates it with a file. In the process of setting up this association, the named file is opened by the system, and a description of the open file is set up so that I/O functions referring to that file can use the state information contained in the description.
Each time NXFileOpen is called, a new file descriptor is generated (even when the same pathname is opened).
By default, the share mode of NX_SHARE_DENYNO is used for NXFileOpen.