Task

(Over)write a file so that it contains a string.



The reverse of Read entire file—for when you want to update or create a file which you would read in its entirety all at once.




use System.IO.File;
 
class WriteFile {
  function : Main(args : String[]) ~ Nil {
    writer ← FileWriter→New("test.txt");
    leaving {
      writer→Close();
    };
    writer→WriteString("this is a test string");
  }
}