diskfile = File.new("foofile","w")
puts "Hello..."      # prints to stdout
$stdout = diskfile
puts "Goodbye!"      # prints to "foofile"
diskfile.close
$stdout = STDOUT     # reassign to default
puts "That's all."   # prints to stdout

