Project

General

Profile

Bug #7979

File.foreach splits on 'r' in windows

Added by Steve Kingston about 3 years ago. Updated about 3 years ago.

Status:
Rejected
Priority:
Normal
Assignee:
-
[ruby-core:53005]

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 [ruby-core:53110] Updated by Nobuyoshi Nakada about 3 years 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