Writing to a Temporary File : Tempfile « File Directory « Ruby






Writing to a Temporary File


require 'tempfile'
out = Tempfile.new("tempfile")
out.path                           

out << "Some text."
out.rewind
out.read                           
out.close

 








Related examples in the same category

1.Tempfile can create temporary files for you
2.Create a temp file under
3.move a file with fileutils