File.Append
Skip to content
mnscript
StringResult File.Append(string, string, string) 

Description ​

Appends a string onto a file.

Arguments ​

string - The directory to place the file.
string - The file name to append.
string

Returns ​

StringResult - A StringResult representing the success/failure of the operation.

Example ​

msc
using File;
using Console;
using System;

// Appends the text "\n My text hello!" in to "my_file.txt" in "r/documents".

StringResult result = File.Append("r/documents", "my_file.txt", "\n My text hello!");

if(result.GetResult()){
    Console.WriteLine("The file was successfully appended!");
}else{
    // If the file could not be appended, the result string contains the reason.
    Console.WriteLine("Error: "..result.GetString());
}