Name

FileMode Variable

Syntax

var FileMode: Integer;

Description

When opening a binary file with Reset, Delphi always opens the file using the mode specified by FileMode. The possible values for FileMode are as follows:

0

Read only

1

Write only

2

Read and write

The default value is 2.

Tips and Tricks

  • To open an existing file for read-only access, be sure to set FileMode to zero before calling Reset. If you do not set FileMode, Reset will fail when trying to open a read-only file, such as a file on a CD-ROM.

  • To append to a binary file, set FileMode to 1 or 2, open the file with Reset, seek to the end of the file, and then begin writing.

  • FileMode is not used when opening text files.

  • FileMode is not used when opening a binary file with Rewrite.

See Also

Reset Procedure
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset