View Problem

Write a string to a file

DiskEdit
ruby
File.new("a_file", "w") << "some text"
ExpandDiskEdit
erlang
Line = "This line overwites file contents!\n",
{ok, IODevice} = file:open("test.txt", [write]), file:write(IODevice, Line), file:close(IODevice).
DiskEdit
csharp
System.IO.File.WriteAllText("filename.txt", "Some text to write to the file");
ExpandDiskEdit
fsharp
let stream = new StreamWriter("test.txt", false)
stream.WriteLine("This line overwrites file contents!")

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