NWOpenDataStream

Opens a data stream associated with any supported name space on the server

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 NWOpenDataStream ( 
      NWCONN_HANDLE         conn,  
      nuint8                dirHandle,  
      const nstr8 N_FAR    *fileName,  
      nuint16               dataStream,  
      nuint16               attrs,  
      nuint16               accessMode,  
      pnuint32              NWHandle,  
      NWFILE_HANDLE N_FAR  *fileHandle);
   

Delphi Syntax

   uses calwin32 
    
   Function NWOpenDataStream 
     (conn : NWCONN_HANDLE; 
      dirHandle : nuint8; 
      const fileName : pnstr8; 
      dataStream : nuint16; 
      attrs : nuint16; 
      accessMode : nuint16; 
      NWHandle : pnuint32; 
      Var fileHandle : NWFILE_HANDLE 
   ) : NWCCODE;
   

Parameters

conn

(IN) Specifies the NetWare server connection handle.

dirHandle

(IN) Specifies the directory handle associated with the directory containing the file. This must be a DOS directory handle; if you want to read from a different namespace, use the dataStream parameter.

fileName

(IN) Points to the name of the file containing the data stream. It must be a DOS file name (and match dirHandle). For example, if you are opening a Macintosh file named "alongfilename," pass a DOS dirHandle and the DOS file name "ALONGFIL."

dataStream

(IN) Specifies the data stream number. To read the primary stream of any file in any namespace, pass 0. For example, to read the data fork of a file in the Macintosh namespace, open a DOS handle, and pass 0. To read the resource fork of a Macintosh handle, pass the DOS directory handle to dirHandle, and pass 1 as the data stream number.

  • 0 NW_DS_DOS
  • 1 NW_DS_MAC
  • 2 NW_DS_FTAM
attrs

(IN) Specifies the attributes to use in searching for the file to open:

C Value

Delphi Value

Value Name

0x00

$00

FA_NORMAL

0x01

$01

FA_READ_ONLY

0x02

$02

FA_HIDDEN

0x04

$04

FA_SYSTEM

0x08

$08

FA_EXECUTE_ONLY

0x10

$10

FA_DIRECTORY

0x20

$20

FA_NEEDS_ARCHIVED

0x80

$80

FA_SHAREABLE

accessMode

(IN) Specifies the rights to use in opening the file (see Section 20.1, Access Right Values).

NWHandle

(OUT) Points to a 4-byte NetWare handle to dataStream (optional).

fileHandle

(OUT) Points to a file handle.

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

0x8980

ERR_LOCK_FAIL

0x8982

NO_OPEN_PRIVILEGES

0x8990

NO_FILES_AFFECTED_READ_ONLY

0x89BE

INVALID_DATA_STREAM

0x89FF

NO_FILES_FOUND_ERROR

Remarks

NWOpenDataStream also obtains a NetWare file handle to a data stream.

If you pass a non-DOS namespace handle to dirHandle, NWOpenDataStream fails.

These constants identify trustee access rights for opening a a directory with NWOpenDataStream.

C Value

Delphi Value

Value Name

Value Description

0x00

$00

TA_NONE

Specifies no Reads or Writes are allowed.

0x01

$01

TA_READ

Specifies file Reads are allowed.

0x02

$02

TA_WRITE

Specifies file Writes are allowed.

0x08

$08

TA_CREATE

Specifies files can be created.

0x10

$10

TA_DELETE

Specifies files can be deleted.

0x20

$20

TA_OWNERSHIP

Specifies subdirectories can be created or deleted and trustee rights granted or revoked.

0x40

$40

TA_SEARCH

Specifies the directory can be searched.

0x80

$80

TA_MODIFY

Specifies file attributes can be modified.

0xFB

$FB

TA_ALL

Specifies the trustee has all the above rights to the directory.

NCP Calls

See Also

NWAFPOpenFileFork (Single and Intra-File Management), NWConvertHandle