DFSRead

Reads the sectors requested from a file using DFS (sleeps until completion)

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 DFSRead  (  
     LONG    fileHandle,   
     LONG    startingSector,   
     LONG    sectorCount,   
     BYTE   *buffer); 
  

Parameters

fileHandle
(IN) Specifies the file handle returned from a prior call to open for the indicated file.
startingSector
(IN) Specifies the starting sector number (logical offset from beginning of the file) in the file where the read operation is to begin.
sectorCount
(IN) Specifies the number of sectors to be read into the buffer.
buffer
(OUT) Points to a contiguous buffer area large enough to contain the number of sectors indicated to be read.

Return Values

Decimal

Constant

Description

0

DFSNormalCompletion

The operation was completed as specified.

17

DFSHoleInFileError

A read was attempted to file sector addresses where no file blocks are allocated. The buffer is zero-filled.

18

DFSParameterError

The caller supplied one or more invalid parameters.

23

DFSNotInDirectFileMode

A direct file read ( DFSRead) was issued but the file has not been opened successfully in direct mode.

24

DFSOperationBeyondEndOfFile

A read function was requested beyond the current end of file.

131

DFSHardIOError

 

136

DFSInvalidFileHandle

A DFS call was made using a file handle which is not valid. Typically an open was omitted or the user inadvertently closed the file before attempting this access.

147

DFSNoReadPrivilege

Current connection does not have read privileges for the file.

149

DFSFileDetached

The function was not completed because the file is detached.

150

DFSInsufficientMemory

DFS could not allocate sufficient memory to complete the request.

162

DFSIOLockError

 

Remarks

This function performs a read of one or more sectors using a logical zero-based sector offset into the indicated file. Since this function is blocking, control is returned to the caller after all reads relating to the requested read function have been completed. If a status indicating a hole was detected during the requested read operation, the buffer is zeroed. It is not possible to read beyond the end of the allocated area of a file.

See Also

DFSReadNoWait, DFSWrite