FilePath (string): The full path of the file. The file will be created if it doesn't exist. Environment variables in the form %variable% for windows, and $variable for non-windows operating systems will be expanded.
Text (string): The text string to be appended to an existing file or written to a new file.
Backup (bool; optional, default
false): Whether or not to backup the file prior to writing. If the file already exists, a copy of the file will be made in the same directory with the .
bak suffix. If this backup file already exists, an incrementing number will be added after the extension. If a backup cannot be created, this method will return an error.
NewLine (bool; optional, default
false) If true an O/S-specific line separator sequence will be written before the Text is written or appended.
Encoding (string, optional, default "
ANSI" for Android else "
UTF8NOBOM" for all other platforms): File content encoding. Valid values are:
- “UTF8” - UTF8 with a byte order mark.
- “UTF8NOBOM” - UTF8 without a byte order mark.
- “UTF16LE” - UTF16 little endian byte order.
- “UTF16BE” - UTF16 big endian byte order.
If the file already exists and has content then an encoding should not be specified.