_lwrite

Syntax

int _lwrite(hFile,lpBuffer,wBytes)

This function writes data into the file specified by the hFile parameter. The wBytes parameter specifies the number of bytes to write from the buffer identified by lpBuffer. The function return value indicates the number of bytes actually written to the file.

Parameter Type/Description  

hFile int Specifies the MS-DOS file handle of the file into which data is to be written.  
lpBuffer LPSTR Points to a buffer that contains the data to be written to the file.  
wBytes WORD Specifies the number of bytes to be written to the file.  

Return Value

The return value indicates the number of bytes actually written to the file, or –1 if the
function fails.

Comments

The buffer specified by lpBuffer cannot extend past the end of a segment.