Show: Delphi C++
Display Preferences

System.FileMode

From XE2 API Documentation
Jump to: navigation, search

Delphi

FileMode: Byte = 2;       { Standard mode for opening files }

C++

extern PACKAGE Byte FileMode;

Properties

Type Visibility Source Unit Parent
variable public
System.pas
System.hpp
System System

Description

Indicates the access mode on typed and untyped files opened by the Reset procedure.

In Delphi code, FileMode determines the access mode to use when typed and untyped files (not text files) are opened using the Reset procedure.

The file open modes that can be assigned to the FileMode variable are defined in the Constants list on System.SysUtils.

The default FileMode is 2 (Read/Write access). Assigning another value to FileMode causes all subsequent Resets to use that mode.

Note: Be sure to reset FileMode before calling Reset with a read-only file. Even if you are only reading from the file, the default FileMode value (Read/Write access) will cause an attempt to open a read-only file to fail.
Warning: FileMode is declared as a variable, not as a threadvar. Therefore this variable is not thread-safe.

See Also

Personal tools
Previous Versions
Translations