Xojo.IO.TextOutputStream.Append

From Xojo Documentation

Shared Method

Opens the passed file so that text can be appended to existing text.

Exceptions

  • IOException for these conditions:
    • file does not exist
    • file is not writeable
    • containing folder is not writeable
    • the FolderItem is Nil
    • a system I/O error occurs

Sample Code

Using Xojo.Core
Using Xojo.IO

Var f As FolderItem
f = SpecialFolder.Documents.Child("SaveData.txt")

Var output As TextOutputStream
Try
output = TextOutputStream.Append(f, TextEncoding.UTF8)
output.WriteLine("This text is appended to the end of the file.")
output.Close
Catch e As IOException
Label1.Value = "Unable to append to file."
End Try