Marshal/IO.eof bug
------------------

                 Key: JRUBY-2506
                 URL: http://jira.codehaus.org/browse/JRUBY-2506
             Project: JRuby
          Issue Type: Bug
          Components: Core Classes/Modules
    Affects Versions: JRuby 1.1.1, JRuby 1.0.3
            Reporter: Chris Goard


The following code seems to work in MRI, but not in jruby:

{code:none|title=iotest.rb}
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
{code}

{noformat}
% 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
{noformat}

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

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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

    http://xircles.codehaus.org/manage_email


Reply via email to