S
Simon Strandgaard
While upgrading rubicon from 1.6 to 1.8, I bumped into
this problem in the builtin/TestIO.rb file.
http://rubyforge.org/cgi-bin/viewcvs/cgi/viewcvs.cgi/rubicon/builtin/TestIO.rb?cvsroot=rubytests
I have extracted the code which reproduces the problem.
Any ideas on how to solve it, would be nice.
server> rm testtest
server> ruby a.rb
a.rb:5:in `close': Bad file descriptor - testtest (Errno::EBADF)
from a.rb:5:in `open'
from a.rb:5
server> expand -t2 a.rb
file = "testtest"
File.open(file, "w") do |f|
10.times { |i| f.printf "%02d: This is a line\n", i }
end
File.open(file, "w") do |f|
io = IO.new(f.fileno, "w")
io << 1 << "\n" << "dummy" << "\n" << "cat\n"
io.close
end
server>
this problem in the builtin/TestIO.rb file.
http://rubyforge.org/cgi-bin/viewcvs/cgi/viewcvs.cgi/rubicon/builtin/TestIO.rb?cvsroot=rubytests
I have extracted the code which reproduces the problem.
Any ideas on how to solve it, would be nice.
server> rm testtest
server> ruby a.rb
a.rb:5:in `close': Bad file descriptor - testtest (Errno::EBADF)
from a.rb:5:in `open'
from a.rb:5
server> expand -t2 a.rb
file = "testtest"
File.open(file, "w") do |f|
10.times { |i| f.printf "%02d: This is a line\n", i }
end
File.open(file, "w") do |f|
io = IO.new(f.fileno, "w")
io << 1 << "\n" << "dummy" << "\n" << "cat\n"
io.close
end
server>