From: "SHULTZ,BARRY (HP-Israel,ex1)" Date: 2001-04-05T20:54:45+09:00 Subject: [ruby-talk:13509] Re: BUG?: HP-UX 10.20 and IO#gets followed by IO#puts Thanks, Guy. > Seems normal for me :-))) If it's normal, though, why are the results different on HP-UX and NT? > > Try to add > > S> [derby]:cat /tmp/a.txt > S> line 1 > S> [derby]:/mnt/ruby162/bin > ./irb > S> irb(main):001:0> f = File.new("/tmp/a.txt","r+") > S> # > S> irb(main):002:0> f.gets > S> "line 1\n" > > f.seek 0, IO::SEEK_CUR Yes, now it works fine, but I don't understand why "line 1" appears twice without IO#seek. Barry