System.IOUtils.TFile.AppendAllText
Delphi
class procedure AppendAllText(const Path, Contents: string); overload; static;
class procedure AppendAllText(const Path, Contents: string;
const Encoding: TEncoding); overload; static;
C++
static void __fastcall AppendAllText(const System::UnicodeString Path, const System::UnicodeString Contents)/* overload */;
static void __fastcall AppendAllText(const System::UnicodeString Path, const System::UnicodeString Contents, System::Sysutils::TEncoding* const Encoding)/* overload */;
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
procedure function |
public | System.IOUtils.pas System.IOUtils.hpp |
System.IOUtils | TFile |
Description
Appends a given text to a file.
Use AppendAllText to append a given text to a file. If the file specified by the Path parameter exists, the text is appended to it; otherwise, the file is created and filled with the given text. The following table lists the parameters expected by this method.
Name | Meaning |
---|---|
Path |
The path to the file. |
Contents |
The string containing the text to be appended. |
Encoding |
The encoding used for the appended text. |
Note: AppendAllText raises an exception if the file cannot be accessed or the path is invalid.