File.gets(delimiter) ignores the delimiter on JRuby 1.4.0
---------------------------------------------------------
Key: JRUBY-4416
URL: http://jira.codehaus.org/browse/JRUBY-4416
Project: JRuby
Issue Type: Bug
Components: Core Classes/Modules
Affects Versions: JRuby 1.4
Environment: JRuby 1.4.0, Windows XP sp3, x86
Reporter: Steve Shreeve
Priority: Minor
I often use File#gets(delimiter) to read a file up to a certain delimiter. In
JRuby, it appears the delimiter is ignored. See the results section in the test
case below.
==
# create test file
File.open("gets.out", "wb") do |file|
file.print "this is a test\xFFit is only a test\ndoes it work?"
end
# read test file
print RUBY_VERSION + " => "
File.open("gets.out", "rb") do |file|
p file.gets("\xFF")
end
__END__
Results:
MRI shows:
1.8.6 => "this is a test\377"
YRI shows:
1.9.1 => "this is a test\xFF"
JRuby 1.4.0 shows:
1.8.7 => "this is a test\377it is only a test\ndoes it work?"
--
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