Opens a file (comprehensive interface).
#include <nks/fsio.h> int NXFileOpenEx ( NXFileOpenSpec_t *openSpec, NXHandle_t *fileHandle);
(IN) Points to the NXFileOpenSpec_t structure, which contains open call parameters.
(OUT) Points to an integer-valued open file descriptor on success. On failure, return -1.
If successful, returns 0 and an open file descriptor in fileHandle. Otherwise, returns an error code. On failure the new file remains unopened. However, if the request was to overwrite a file and NXFileOpenEx fails, the file might be destroyed in the process.
NXFileOpenEx creates or opens a file and associates it with an open file handle that can be used to perform I/O operations on the file. If the file is successfully opened, a file handle (which can be used by all handle-based NDK file functions) is returned in the fileHandle parameter.
If the file is already open, the fosShareMode and fosMode fields are used to check whether the current open request can be allowed. If the file is not already open, fosShareMode and fosMode determine what kind of sharing is allowed (if any) for future opens on the file while it is still open.
Each call to NXFileOpenEx generates a new file descriptor, even when the same pathname is opened.