View Problem

Append to a file

DiskEdit
ruby
file = File.new('/tmp/test.txt', 'a+') ; file.puts 'This line appended to file!!' ; file.close()
ExpandDiskEdit
cpp C++/CLI .NET 2.0
IO::StreamWriter^ stream;

try
{
stream = gcnew IO::StreamWriter("test.txt", true);
stream->WriteLine("This line appended to file!");
}
ExpandDiskEdit
fsharp
let stream = new StreamWriter("test.txt", true)
stream.WriteLine("This line appended to file!")
ExpandDiskEdit
clojure
(with-out-append-writer "output.txt" (println "This is appended to the file"))

Submit a new solution for ruby, cpp, fsharp, or clojure
There are 13 other solutions in additional languages (csharp, erlang, fantom, groovy ...)