From: Run Paint Run Run Date: 2009-09-05T04:51:07+09:00 Subject: [ruby-core:25376] [Bug #1755] IO#reopen Doesn't Fully Associate with Given Stream on 1.9; Ignores pos on 1.8 Issue #1755 has been updated by Run Paint Run Run. > On your platform, ruby 1.8 seems to copy the position in the stream > when 1.9 don't. 1.8 does simply use dup2 + fdopen, where no standard > define if position information is shared among such file descriptors > or not, as far as I know. So it's up to stdio of the platform. 1.9 > implements our own I/O, so we can define the behavior. Apologies for being dense, but does this apply only to copying across the #pos, or to all of the differences I described? IOW, is the behaviour below intentional on 1.9, i.e. by design, or operating-system dependent ("undefined")? $ cat reopen.rb File.open('f','w') do |f| 10000.times {|n| f.puts n } end a = File.open('f') b = File.open('f') a.reopen(b) a.gets a.reopen(b) p a.gets $ ruby -v reopen.rb ruby 1.9.2dev (2009-09-03 trunk 24741) [i686-linux] "60\n" $ ruby8 -v reopen.rb ruby 1.8.8dev (2009-09-04) [i686-linux] "0\n" ---------------------------------------- http://redmine.ruby-lang.org/issues/show/1755 ---------------------------------------- http://redmine.ruby-lang.org