NWOpenNSEntryExt

Opens or creates a file or creates a subdirectory with a given owning name space and using UTF-8 strings.

Local Servers:blocking
Remote Servers:blocking
NetWare Server:6.5 SP2 or later
Platform:NLM, Windows 2000, Windows XP
Client:4.90 SP2 or later
Library:Cross-Platform NetWare Calls (CAL*.*)
Service:Name Space

Syntax

   #include <nwnamspc.h> 
   or 
   #include <nwcalls.h> 
    
   NWCCODE N_API NWOpenNSEntryExt ( 
      NWCONN_HANDLE          conn,  
      nuint8                 dirHandle,  
      nuint8                 namSpc,  
      nuint8                 dataStream,  
      const nstr8   N_FAR   *path,  
      NW_NS_OPEN    N_FAR   *NSOpen,  
      NWFILE_HANDLE  N_FAR  *fileHandle);
   

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, it can point to an absolute path if dirHandle is zero. The characters in the string must be UTF-8.

NSOpen

(IN/OUT) Points to NW_NS_OPEN 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. You can use this handle with the OS functions for reading, writing, and closing.

Return Values

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

0x0000

SUCCESSFUL

0x8801

INVALID_CONNECTION

0x88F0

UTF8_CONVERSION_FAILED

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

Value Name

0x01

OC_MODE_OPEN

0x02

OC_MODE_TRUNCATE

0x02

OC_MODE_REPLACE

0x08

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

Value Name

0x01

OC_ACTION_NONE

0x01

OC_ACTION_OPEN

0x02

OC_ACTION_CREATE

0x04

OC_ACTION_TRUNCATE

0x04

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.

NCP Calls

See Also

NWDeleteNSEntryExt, NWOpenCreateNSEntryExt