From: Chad Fowler Date: 2004-03-15T10:24:18+09:00 Subject: Re: Ruby 1.8.1 write to file? On Mar 14, 2004, at 8:04 PM, Kristian S�rensen wrote: > Hi! > > I have upgraded to ruby 1.8.1 .. and suddenly now my file-writing does > not work. I get an error like: > > script:line:in `close': uninitialized stream (IOError) > > The code looks like this: > > File.open("e_macs.txt", "a") { |f| > f << Time.new.to_s > f << "\n" > } > > What happend in writing to files from 1.6 to 1.8? I tried my way > through rubycentral.com .. but apparently the API is not updated. > > How do I handle file writing (or reading) in Ruby 1.8? > > Can you show us your ruby -v output? I'm on "ruby 1.8.1 (2003-12-25) [powerpc-darwin]" and it works without a problem. Chad