Deletes the file and writes text to the file after creating it.
OutputVar := FileReplace(Text, Filename , Options)Command Example: FileReplace "text",A_ScriptDir "\MyFile.txt" Function Example: Success := FileReplace("text",A_ScriptDir "\MyFile.txt")
The name of the variable in which to store true if file was replaced or false otherwise.
The text to append to the file. See more info in FileAppend.
The name of the file to be appended, which is assumed to be in %A_WorkingDir% if an absolute path isn't specified.
See FileAppend options.
FileOpen in append mode provides more control than FileAppend and allows the file to be kept open rather than opening and closing it each time. Once a file is opened in append mode, use file.Write(string)
to append the string. File objects also support binary I/O via RawWrite/RawRead or WriteNum/ReadNum, whereas FileAppend supports only text.
FileReplace "New content`n", "C:\My Documents\Test.txt"