From: 7stud -- Date: 2007-09-30T23:37:10+09:00 Subject: Re: Newbie needs help getting user input Peter Vanderhaden wrote: > Sebastian, > FYI, the reason I'm sending the prompt to STDERR instead of STDOUT is > that I've used reopen to redirect STDOUT to a file. I did that because > I want to write data to a file. I'm new to this, so if there's a better > way to write to the file, I'm all ears :) > How about: 1) f = File.new("data.txt", "w") f.write("hello world\n") f.close() 2) f = File.open("data.txt", "w") do |file| file.puts("goodbye mars") end -- Posted via http://www.ruby-forum.com/.