_lwrite

  UINT _lwrite(hFile, lpBuffer, cbWrite)    
  HFILE hFile; /* file handle */
  LPCSTR lpBuffer; /* address of buffer for write data */
  UINT cbWrite; /* number of bytes to write */

The _lwrite function writes data to the specified file.

Parameters

hFile

Identifies the file to write to.

lpBuffer

Points to a buffer that contains the data to write to the file.

cbWrite

Specifies the number of bytes to write to the file.

Return Value

The return value indicates the number of bytes actually written to the file if the function is successful. The return value is -1 if the function failed.

Comments

This function is maintained for compatibility with previous versions of Windows. Win32 applications should use the WriteFile function to write to a file.

See Also

_lread, WriteFile