Project

General

Profile

Actions

Bug #6271

closed

textmode File#read on CRLF

Added by riskwa (riskwa anon) over 12 years ago. Updated over 12 years ago.

Status:
Closed
Target version:
ruby -v:
1.9.3p125 (2012-02-16) [i386-mingw32]
Backport:
[ruby-core:44189]

Description

I'm not sure this is bug,
when "File#read(X)" for textmode finishes inside of CRLF, stream keeps CR unread against my intuition.
The following code prints "\r" forever for CRLF.

File.open(FILE, "r") do |f|
until f.eof?
p f.read(1)
end
end


Files

read_eof.patch (1.1 KB) read_eof.patch h.shirosaki (Hiroshi Shirosaki), 04/08/2012 10:34 PM
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0