NWOpenFile(3nw)


NWOpenFile -- opens an existing NetWare file and retrieves NWFILE_HANDLE

Synopsis

   #include <nwmisc.h> 
   or 
   #include <nwcalls.h> 
   

NWCCODE N_API NWOpenFile (NWCONN_HANDLE conn, NWDIR_HANDLE dirHandle, pnstr8 fileName, nuint16 searchAttr, nuint8 accessRights, NWFILE_HANDLE fileHandle);

Description

The parameters are as follows:

conn
(IN) Specifies the connection on which to open file.

dirHandle
(IN) Specifies the directory handle of the file to be opened. It specifies the file to open along with fileName.

fileName
(IN) Points to the name of the file to open. It specifies the file to open along with dirHandle.

searchAttr
(IN) Specifies the attributes of the file to be opened.

accessRights
(IN) Specifies the rights of the file when opened.

fileHandle
(OUT) Receives to the NetWare handle of the opened file.

Return values

0x0000
SUCCESSFUL

0x8980
ERR_LOCK_FAIL

0x8981
NO_MORE_FILE_HANDLES

0x8982
NO_OPEN_PRIVILEGES

0x8994
NO_WRITE_PRIVILEGES_OR_READONLY

0x8996
SERVER_OUT_OF_MEMORY

0x8998
VOLUME_DOES_NOT_EXIST

0x899C
INVALID_PATH

0x89A1
DIRECTORY_IO_ERROR

0x89FF
Failure

Notices

The FA_HIDDEN (0x02) and FA_SYSTEM (0x04) bits in the client's searchAttr flag are used to discover or ignore system and hidden files. File Name is a valid file path and is used with the Directory Handle to indicate which file should be opened.

If this client lacks file open privileges in the target directory, the request fails.

The accessRights flag is a bit field with the following bits defined:

0
Open the file for reading (READ).

1
Open the file for writing (WRITE).

2
Do not allow other clients to open this file for writing (DENY WRITE).

3
Do not allow other clients to open this file for reading (DENY READ).

4
This client assumes a single-user environment (EXCLUSIVE).

5
Not defined

6
AR_WRITE_THROUGH

7
Not defined

The accessRights flag designates which access rights a client wants in a specified file. The client's initial accessRights are modified to reflect the actual access rights the client is allowed to the specified file. Modifications are determined as follows:

ServicesFile I/O

NCP calls

0x2222 76
Open File

References

NWCloseFile(3nw), NWOpenDataStream(3nw), NWAFPOpenFileFork(3nw), NWOpenCreateNSEntry(3nw), NWOpenNSEntry(3nw)
30 January 1998
© 1998 The Santa Cruz Operation, Inc. All rights reserved.