Opens the requested file in Direct File Mode.
#include <dfs.h>
int dfs_sopen (
const char *path,
int oflag,
int shflag,
int *err,
... );
(IN) Points to the name of the file to be opened. The file name must be NULL-terminated and must include the path including the volume name but not the server name.
(IN) Specifies the open access mode. See File Control Open Modes.
(IN) Specifies the share mode for the file and uses one of the following:
(OUT) Points to an error code value, when dfs_sopen returns -1.
(IN) Specifies an optional mode argument when the O_CREAT flag is specified in oflag. See File Access Modes and NetWare Attributes.
If successful, returns a file descriptor, which is a non-negative integer. Otherwise, returns -1 and sets the err parameter to one of the following values:
The name of the file to be opened is given by the path parameter. The file is opened according to the mode specified by the oflag parameter.
When a file is opened in direct file mode by calling dfs_sopen, DFS flags the file as being in direct file mode. In this mode, the cache is bypassed for future I/O calls to the file. Existing cache entries for the file are flushed and a turbo FAT for the file is built if one does not currently exist.
This function can cause problems with other applications that have already opened the file in normal non-direct mode. In this case, the file is switched to direct mode, and the program with the file open in normal mode is able to read the file but cannot write to it. A close must be issued for each handle obtained by an open for the file before the file can be reopened for full normal mode access again (see Input and Output).