Bug 2163 – successfully reading doesn't necessarily mean not EOF in the stream

Status
RESOLVED
Resolution
WONTFIX
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D1 (retired)
Platform
x86
OS
Windows
Creation time
2008-06-22T21:15:00Z
Last change time
2015-11-03T19:16:00Z
Assigned to
nobody
Creator
davidl

Comments

Comment #0 by davidl — 2008-06-22T21:15:33Z
// read from source size_t readBlock(void* buffer, size_t size) { size_t res = s.readBlock(buffer,size); readEOF = res == 0; return res; } readEOF = res == 0; <-- this should perform real test on the stream to see if real EOF reached. other wise, stream.eof become something useless. I need to catch ReadException. and the following coding pattern is not working with the current implementation: while (stream.eof) { stream.read(mydchar); // if last time exactly read all data from the stream. it will throw ReadException }
Comment #1 by andrei — 2015-11-03T19:16:00Z
It's unlikely this D1 issue will get worked on. If it applies to D2 as well and/or if anyone plans to work on it, please reopen.