Opens or creates a file or creates a subdirectory with a given owning name space
#include <nwnamspc.h>
or
#include <nwcalls.h>
NWCCODE N_API NWOpenNSEntry (
NWCONN_HANDLE conn,
nuint8 dirHandle,
nuint8 nameSpc,
nuint8 dataStream,
const nstr8 N_FAR *path,
NW_NS_OPEN N_FAR *NSOpen,
NWFILE_HANDLE N_FAR *fileHandle);
uses calwin32
Function NWOpenNSEntry
(conn : NWCONN_HANDLE;
dirHandle : nuint8;
namSpc : nuint8;
dataStream : nuint8;
const path : pnstr8;
Var NSOpen : NW_NS_OPEN;
Var fileHandle : NWFILE_HANDLE
) : NWCCODE;
(IN) Specifies the NetWare server connection handle.
(IN) Specifies the directory handle associated with the directory in which to create the file.
(IN) Specifies the name space for the file creation (see Section 20.5, Name Space Flag Values).
(IN) Specifies the data stream number if the name space is Mac OS:
For DOS, always pass 0.
(IN) Points to the name to use in creating the file. Optionally contains a volume:path specification.
(IN/OUT) Points to NW_NS_OPENCREATE containing the information needed to open the entry. Results of a successful open are also returned in NW_NS_OPENCREATE.
(OUT) Points to the OS file handle; it returns zero if you are creating subdirectories.
These are common return values; see Return Values (Return Values for C) for more information.
dirHandle can be zero if the path contains the complete path, including the volume name. ( dirHandle / path should match namSpc.)
If you are creating a directory, pass NULL to fileHandle.
OC_MODE_ constants used in openCreateMode are listed below:
|
C Value |
Delphi Value |
Value Name |
|---|---|---|
|
0x01 |
$01 |
OC_MODE_OPEN |
|
0x02 |
$02 |
OC_MODE_TRUNCATE |
|
0x02 |
$02 |
OC_MODE_REPLACE |
|
0x08 |
$08 |
OC_MODE_CREATE |
See Section 20.8, Search Attributes Values for the possible values for the searchAttributes field.
See Section 20.1, Access Right Values for the possible values for the desiredAccessRights field.
OC_ACTION_ constants used in openCreateAction are listed below:
|
C Value |
Delphi Value |
Value Name |
|---|---|---|
|
0x01 |
$01 |
OC_ACTION_NONE |
|
0x01 |
$01 |
OC_ACTION_OPEN |
|
0x02 |
$02 |
OC_ACTION_CREATE |
|
0x04 |
$04 |
OC_ACTION_TRUNCATE |
|
0x04 |
$04 |
OC_ACTION_REPLACE |
The file handle returned is appropriate for the platform the API is written for. This file handle may be used for access to the attribute value through standard file I/O with the handle. This includes closing the file as well as reading and writing to the file.
NOTE:When using this function to create a directory, the access rights field in the NSOpen structure is used to set the IRF on the created directory. Hence a value of 0xFF should be used if an IRF of [SRWCEMFA] is required.