Message-ID: <3973AAC0.FD795944@gmx.de> Date: Tue, 18 Jul 2000 02:54:24 +0200 From: Hanno Stehling X-Mailer: Mozilla 4.6 [de]C-CCK-MCD QXW0321s (Win98; I) X-Accept-Language: de,en MIME-Version: 1.0 To: djgpp AT delorie DOT com Subject: Problem with ifstream.eof() Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Reply-To: djgpp AT delorie DOT com ifstream.eof() returns FALSE, although the current position in the file is EOF. After reading one more byte, ifstream.eof() returns TRUE, but, of course, ifstream.good() returns FALSE. example code: Let's say "test.dat" is a file with a size of exactly 10 Bytes. ifstream f1("test.dat", ios::in | ios::bin); unsigned char buffer[10]; f1.read(buffer, 10); Now, I think, f1.eof() should return TRUE, but it returns FALSE. f1.read(buffer, 1); Now, after reading one Byte too much, it returns TRUE. Thanks for answering, HST