Project

General

Profile

Backport #2168

File.eof? does not work correctly

Added by vo.x (Vit Ondruch) over 9 years ago. Updated about 8 years ago.

Status:
Closed
Priority:
Normal
[ruby-core:25881]

Description

=begin
C:>echo test > c:\eof.txt

C:>ruby19\bin\irb
irb(main):001:0> File.open 'c:/eof.txt', 'r' do |f|
irb(main):002:1* while !f.eof? do
irb(main):003:2* p f.readline
irb(main):004:2> end
irb(main):005:1> end
"test \n"
EOFError: end of file reached
from (irb):3:in readline'
from (irb):3:in
block in irb_binding'
from (irb):1:in open'
from (irb):1
from C:/Amberg/A_ATOFFICE/GRPOffice2/DeployRelease/Ruby/bin/irb:12:in
'
irb(main):006:0>
=end


Related issues

Has duplicate Ruby trunk - Bug #2380: IO#eof? behavior different with 1.9.1p243-mingw32 than other platformsClosed11/18/2009Actions

Associated revisions

Revision e57e5c5b
Added by yugui (Yuki Sonoda) over 9 years ago

merges r25883 from trunk into ruby_1_9_1. fixes a backpor task #2168.

  • enc/trans/newline.trans (fun_so_universal_newline): generate \n after \r\n detection instead of just after \r. [ruby-list:45988] [ruby-core:25881] [ruby-core:26788]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@26015 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

History

#1

Updated by usa (Usaku NAKAMURA) over 9 years ago

  • Target version set to 2.0.0

=begin
it seems to be a problem of text mode.
open with 'rb', no problem.
open with 'rt', EOFError occurs.
=end

#2

Updated by akr (Akira Tanaka) over 9 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

=begin
This issue was solved with changeset r25883.
Vit, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.

=end

#3

Updated by usa (Usaku NAKAMURA) over 9 years ago

  • Status changed from Closed to Assigned
  • Assignee set to yugui (Yuki Sonoda)

=begin

=end

#4

Updated by yugui (Yuki Sonoda) over 9 years ago

  • Status changed from Assigned to Closed

=begin
This issue was solved with changeset r26015.
Vit, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.

=end

Also available in: Atom PDF