DFSclose

Closes a file currently open in Direct File Mode

Local Servers:blocking
Remote Servers:N/A
NetWare Server:4.x, 5.x, 6.x
Platform:NLM
Service:Direct File System

Syntax

  #include <nwdfs.h>  
   
  LONG DFSclose  (  
     LONG   fileHandle); 
  

Parameters

fileHandle
(IN) Specifies the file handle returned from a prior successful call to DFSsOpen (the file must have previously opened by DFSsOpen). After a file is closed, the file handle is no longer valid and should not be reused.

Return Values

Decimal

Hex

Status Code

Description

0

(0x00)

DFSNormalCompletion

The operation was completed as specified.

-1

 

DFSFailedCompletion

An error occurred closing the file. If this status is returned, errno is set to: 4 EBADF (Bad file number). If the function does not complete successfully, NetWareErrno is set.

Remarks

Calling DFSclose causes the file to be closed (the handle becomes invalid). If DFSClose determines that this was the last valid handle (no other opens outstanding for the file), the Direct File Mode flag is reset, allowing a subsequent open file call to be either open (normal mode), or DFSsOpen (direct mode). Remember, if a file is in direct mode, any programs with normal mode opens into the file are able to read the file but not write to it (see Input and Output).

See Also

DFSsopen