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
File.write may be called with a mode option 'wb' that prevents the default behavior of changing \n to \r\n on Windows. This behaviour does not work with jruby. A normal File.open with mode 'wb' does work. Please have a look at the following example irb session.
=> "jruby 1.7.4 (1.9.3p392) 2013-05-16 2390d3b on Java HotSpot(TM) Client VM 1.6.0_21-b07 [Windows 7-x86]"
irb(main):017:0> File.open('test1.txt', mode: 'wb') {|f| f.write("\n")}
=> 1
irb(main):018:0> File.write('test1.txt', "\n", mode: 'wb') # writes two bytes instead of one
=> 2
The text was updated successfully, but these errors were encountered:
File.write may be called with a mode option 'wb' that prevents the default behavior of changing \n to \r\n on Windows. This behaviour does not work with jruby. A normal File.open with mode 'wb' does work. Please have a look at the following example irb session.
The text was updated successfully, but these errors were encountered: