NWAFPOpenFileFork

Opens an AFP file fork from a DOS environment

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:AFP

Syntax

  #include <nwafp.h> 
  or 
  #include <nwcalls.h> 
   
  NWCCODE NWAPI NWAFPOpenFileFork ( 
     NWCONN_HANDLE        conn,  
     nuint16              volNum,  
     nuint32              AFPEntryID,  
     nuint8               forkIndicator,  
     nuint8               accessMode,  
     const nstr8 N_FAR   *AFPPathString,  
     pnuint32             fileID,  
     pnuint32             forkLength,  
     pnuint8              NWHandle,  
    NWFILE_HANDLE N_FAR  *DOSFileHandle);
  

Delphi Syntax

  uses calwin32 
   
  Function NWAFPOpenFileFork 
    (conn : NWCONN_HANDLE; 
     volNum : nuint16; 
     AFPEntryID : nuint32; 
     forkIndicator : nuint8; 
     accessMode : nuint8; 
     const AFPPathString : pnstr8; 
     fileID : pnuint32; 
     forkLength : pnuint32; 
     NWHandle : pnuint8; 
     Var DOSFileHandle : NWFILE_HANDLE 
  ) : NWCCODE;
  

Parameters

conn
(IN) Specifies the NetWare server connection handle.
volNum
(IN) Specifies the volume number of the directory entry location.
AFPEntryID
(IN) Specifies the AFP base ID.
forkIndicator
(IN) Specifies the data or resource fork indicator:
  • 0 Data
  • 1 Resource
accessMode
(IN) Specifies the file access mode indicator.
AFPPathString
(IN) Points to the AFP directory path relative to AFPEntryID.
fileID
(OUT) Points to the file entry ID.
forkLength
(OUT) Points to the length of the opened fork.
NWHandle
(OUT) Points to the 6-byte NetWare file handle.
DOSFileHandle
(OUT) Points to the 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

0x8980

FILE_IN_USE_ERROR

0x8981

NO_MORE_FILE_HANDLES

0x8988

INVALID_FILE_HANDLE

0x8983

IO_ERROR_NETWORK_DISK

0x8993

NO_READ_PRIVILEGES

0x8994

NO_WRITE_PRIVILEGES_OR_READONLY

0x8996

SERVER_OUT_OF_MEMORY

0x8998

VOLUME_DOES_NOT_EXIST

0x8999

DIRECTORY_FULL

0x899C

Invalid AFP Path String

0x89A1

DIRECTORY_IO_ERROR

0x89A2

READ_FILE_WITH_RECORD_LOCKED

0x89FD

BAD_STATION_NUMBER

0x89FF

LOCK_ERROR, NO_FILES_FOUND_ERROR

Remarks

If a file does not exist, NWAFPOpenFileFork returns NO_FILES_FOUND_ERROR.

If an existing file does not have a resource or data file fork associated with it, NWAFPOpenFileFork will automatically create and open the specified file fork.

accessMode can have the following values:

C Value

Delphi Value

Name

0x0001

$0001

AR_READ and AR_READ_ONLY

0x0002

$0002

AR_WRITE and AR_WRITE_ONLY

0x0004

$0004

AR_DENY_READ

0x0008

$0008

AR_DENY_WRITE

0x0010

$0010

AR_COMPATIBILITY

NCP Calls

See Also

NWAFPCreateFile, NWAFPGetFileInformation, NWAFPGetEntryIDFromName