DFSWrite

Writes sectors into 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 DFSWrite  (  
     LONG    fileHandle,   
     LONG    startingSector,   
     LONG    sectorCount,   
     BYTE   *buffer); 
  

Parameters

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

Return Values

Decimal

Constant

Description

0

DFSNormalCompletion

The operation was completed as specified.

4

DFSVolumeSegmentDeactivated

The volume segments on which the file is located have been deactivated by the operating system.

17

DFSHoleInFileError

An attempt was made to write to a file block address for which space has not been allocated (a hole in a sparse file). Space must be allocated by calling DFSExpandFile to fill holes in sparse files before the associated file block address can be written to successfully when using DFS.

18

DFSParameterError

The function caller supplied an invalid parameter.

23

DFSNotInDirectFileMode

A function requiring a file to be opened in direct mode (using DFSsopen or DFScreat) was requested but the file is not open in direct mode.

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).

148

DFSNoWritePrivilege

The current permissions that the file has been opened with do not allow writes to this file.

149

DFSFileDetached

 

150

DFSInsufficientMemory

The Direct File System could not obtain memory necessary to complete the requested function.

162

DFSIOLockError

 

Remarks

This function performs a write 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 writes relating to the requested write function are completed. If a status indicating a hole was detected during the requested read operation, the operation failed. It is not possible to write beyond the end of the allocated area of a file, or in holes where no blocks are allocated. This function sets a new file size if a write is issued to allocated file space beyond the current file size.

See Also

DFSExpandFile, DFSWriteNoWait