IFile.OpenBinaryWriter

Syntax

OpenBinaryWriter(FileName: String; Truncate: Boolean): IBinaryWriter;

Parameters

FileName - path and name of the file that must be opened.

Truncate - parameter that determines whether a file is cleared during opening. True if it is.

Description

The OpenBinaryWriter method opens a file for writing in a binary format and puts a cursor to the beginning of a file.

Example

Sub UserProc;
Var
    BinW: IBinaryWriter;
Begin
    If File.Exists("c:\New_folder\1.txt"Then
        BinW:=File.OpenBinaryWriter("c:\New_folder\1.txt",True);
        BinW.WriteDateTime(DateTime.Now);
    End If;
End Sub UserProc;

After executing the example the current date and time converted into binary format are written to the 1.txt file. The file is overwritten.

See also:

IFile