Creates and opens a file in Direct File Mode, returning a file handle to the called file.
#include <dfs.h>
int dfs_creat (
const char *path,
mode_t mode,
int shflag,
int *err );
(IN) Points to the name of the file to be created. The filename must be NULL-terminated and must include the path, including the volume name but not the server name.
(IN) Specifies the access permissions for the file. For possible values, 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, if dfs_creat returns -1.
If successful, returns a file descriptor, which is a non-negative integer, and opens the file. Otherwise, returns -1 and sets the err parameter to one of the following values.
Calling dfs_creat causes DFS to create a file, or to truncate the file if it already exists. The name of the file to be created is given by the path parameter. If the file exists, it is truncated to contain no data. The file is switched to direct mode, forcing subsequent file accesses to be direct. The file must be extended using dfs_extend to provide required file space. The file is left open and must be closed by a subsequent call to dfs_close.
Not all functions are allowed with this form of open once the file has been created. If additional functions such as specifying a stream are required, the caller should close the file and open it again by calling dfs_sopen.