From RAD Studio API Documentation
Jump to: navigation, search


function FileWrite(Handle: THandle; const Buffer; Count: LongWord): Integer;
function FileWrite(Handle: THandle; const Buffer:TBytes; Offset, Count: LongWord): Integer;


extern DELPHI_PACKAGE int __fastcall FileWrite(NativeUInt Handle, const void *Buffer, unsigned Count)/* overload */;


Type Visibility Source Unit Parent
function public
System.SysUtils System.SysUtils


Writes the contents of a buffer to the current position in a file.

FileWrite writes Count bytes to the file given by Handle from the buffer specified by Buffer. Handle is a file handle returned by the FileOpen or FileCreate method.

The return value is the number of bytes actually written, or -1 if an error occurred.

Note: Do not mix routines that take or return file handles with those that use Delphi language file variables (typically seen as var F). To write to a file specified by a Delphi file variable, use Write, Writeln, or BlockWrite instead.

See Also

Code Examples