You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Broken in different ways on JRuby 1.7.24 and 9.0.5.0.
Expected Behavior
For the following script:
file="temptemp"File.open(file,"w"){}File.open(file,File::RDWR)do |f|
f.puts("writing")# writes "writing\r\n"f.flush# force to diskgets# do not continue until you can verify it was written rightf.rewind# backuppf.gets# read it but it should be "writing\n"endFile.unlink(file)
The comments dictate how it should behave.
Actual Behavior
On JRuby 1.7.24 it will write "writing\r\n" but it will read "writing\r\n". instead of "writing\n".
On JRuby 9.0.5.0 it wil write "writing\n" instead of "writing\r\n" but it will read "writing\n".
The text was updated successfully, but these errors were encountered:
In doWriteConversion we end up calling needsWriteConversion which returns true because while open for writing we end up setting TEXTMODE in OpenFile. Because this returns true we end up setting the open file to be binary which in turn ends up not converting the \r\n to \n on the gets. Debugger showed that CRLFStreamWrapper is binary on File::RDWR but not when opened up as a plain "r".
Environment
Broken in different ways on JRuby 1.7.24 and 9.0.5.0.
Expected Behavior
For the following script:
The comments dictate how it should behave.
Actual Behavior
On JRuby 1.7.24 it will write "writing\r\n" but it will read "writing\r\n". instead of "writing\n".
On JRuby 9.0.5.0 it wil write "writing\n" instead of "writing\r\n" but it will read "writing\n".
The text was updated successfully, but these errors were encountered: