Ruby Forum JRuby > jruby Marshal/IO.eof bug?

Posted by Chris Goard (Guest)
on 07.05.2008 01:57
(Received via mailing list)
The following code seems to work in MRI, but not in jruby:

  File.open("/tmp/foo", "w") do |f|
    Marshal.dump("hey", f)
    Marshal.dump("there", f)
  end
  File.open("/tmp/foo", "r") do |f|
    puts Marshal.load(f)
    puts Marshal.load(f)
  end

% ruby iotest.rb
hey
there

% jruby iotest.rb
hey
iotest.rb:10:in `load': End of file reached (EOFError)
  from iotest.rb:10
  from iotest.rb:7:in `open'
  from iotest.rb:7

Changing the test to use the loop "while not f.eof" causes jruby to fail
before the first iteration.

I have tried this with jruby 1.0.3 and 1.1.1.

JRuby bug?



chris

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
Posted by Thomas E Enebo (Guest)
on 08.05.2008 22:49
(Received via mailing list)
Please file a Jira issue for this...it defintely looks like a bug.

-Tom

>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>



--
Blog: http://www.bloglines.com/blog/ThomasEEnebo
Email: enebo@acm.org , tom.enebo@gmail.com

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email