Show: Delphi C++
Display Preferences

System.SysUtils.FileWrite

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

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

C++

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

Properties

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

Description

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

Personal tools
In Other Languages
Previous Versions
Assistance