Project

General

Profile

Actions

Bug #12436

closed

newline argument of File.open seems not respected on Windows

Added by Eregon (Benoit Daloze) over 8 years ago. Updated over 2 years ago.

Status:
Closed
Target version:
-
ruby -v:
ruby 2.2.4p230 (2015-12-16 revision 53155) [i386-mingw32]
[ruby-core:75767]
Tags:

Description

File.open("abc", "wt", newline: :lf) { |f|
  f.write "a\n"
  f.puts "b"
}

will create a file with CRLF newlines, ignoring the newline conversion argument.
It should write only LF instead, like on other platforms when the newline conversion is specified.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0