System.FileMode

From RAD Studio VCL Reference
Jump to: navigation, search

Contents

Delphi Information

From System.pas

	FileMode: Byte


Unit: System

Type: variable

Visibility: public

C++ Information

From System.hpp

	unsigned char FileMode;


Unit: System

Type: variable

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 default FileMode is 2 (Read/Write access). Assigning another value to FileMode causes all subsequent Resets to use that mode. The SysUtils unit declares a number of file open mode constants that can be assigned to the FileMode variable.

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
Translations
Newest Version