NWOpenNSEntry

Opens or creates a file or creates a subdirectory with a given owning name space

Local Servers:blocking
Remote Servers:blocking
NetWare Server:3.11, 3.12, 3.2, 4.x, 5.x, 6.x
Platform:NLM, Windows NT, Windows 95, Windows 98
Library:Cross-Platform NetWare Calls (CAL*.*)
Service:Name Space

Syntax

   #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);
   

Delphi Syntax

   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;
   

Parameters

conn

(IN) Specifies the NetWare server connection handle.

dirHandle

(IN) Specifies the directory handle associated with the directory in which to create the file.

namSpc

(IN) Specifies the name space for the file creation (see Section 20.5, Name Space Flag Values).

dataStream

(IN) Specifies the data stream number if the name space is Mac OS:

  • 0 =Resource Fork
  • 1=Data Fork

For DOS, always pass 0.

path

(IN) Points to the name to use in creating the file. Optionally contains a volume:path specification.

NSOpen

(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.

fileHandle

(OUT) Points to the OS file handle; it returns zero if you are creating subdirectories.

Return Values

These are common return values; see Return Values (Return Values for C) for more information.

0x0000

SUCCESSFUL

0x8801

INVALID_CONNECTION

0x890A

NLM_INVALID_CONNECTION

0x8998

VOLUME_DOES_NOT_EXIST

0x899B

BAD_DIRECTORY_HANDLE

0x899C

INVALID_PATH

Remarks

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.

NCP Calls

See Also

NWDeleteNSEntry