DFScreat
Creates and opens a file in Direct File Mode, returning a file handle to the called file
#include <nwdfs.h> LONG DFScreat ( BYTE *fileName, LONG access, LONG flagBits);
!= -1 |
The file now exists, is open, and is in direct mode. The return value is the file handle assigned when the file was created. |
== -1 |
An error occurred creating the file. |
If -1 is returned, errno is set to
Decimal |
Constant |
Description |
---|---|---|
1 |
ENONENT |
No such file. |
6 |
EACCES |
Permission denied. |
9 |
EINVAL |
Invalid argument. |
If the function does not complete successfully, NetWareErrno is set to
Calling DFScreat causes DFS to create a file, or to truncate the file if it already exists and if the current connection has write privileges. The name of the file to be created is given by the filename parameter. If the file exists, it is truncated to contain no data and the preceding permission setting is unchanged. The file is switched to direct mode, forcing subsequent file accesses to be direct (The file must be extended using DFSExpandFile to provide required file space). The file is left open and must be closed by a subsequent call to DFSclose.
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 DFSsopen.
The access permissions are defined in FCNTL.H as follows:
If access is 0, the default value is O_CREAT, O_TRUNC, and O_WRONLY.