Bug #7979

File.foreach splits on 'r' in windows

Added by Steve Kingston about 1 year ago. Updated about 1 year ago.

[ruby-core:53005]
Status:Rejected
Priority:Normal
Assignee:-
Category:-
Target version:-
ruby -v:1.9.3 Backport:

Description

=begin
Calling (({File.foreach('somefile.txt', "r")})) on a windows platform adds newline characters after each lower case (({'r'})), splitting the read lines after each instance.
Reading the following file

This contains r characters
Wreck it Ralph

outputs

This contains r
character
s
Wr
eck it Ralph
=end

History

#1 Updated by Nobuyoshi Nakada about 1 year ago

  • Description updated (diff)
  • Status changed from Open to Rejected

The second argument is a line separator to split the input.

Also available in: Atom PDF