# do2.txt
File.open("file") do |f|
  f << foo
end
