Project

General

Profile

Actions

Backport #2168

closed

File.eof? does not work correctly

Added by vo.x (Vit Ondruch) over 14 years ago. Updated almost 13 years ago.

Status:
Closed
[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 1 (0 open1 closed)

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

Updated by usa (Usaku NAKAMURA) over 14 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

Actions #2

Updated by akr (Akira Tanaka) over 14 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

Actions #3

Updated by usa (Usaku NAKAMURA) over 14 years ago

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

=begin

=end

Actions #4

Updated by yugui (Yuki Sonoda) over 14 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

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0