www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 528] New: cstream.flush() returns EOF early for din.


           Summary: cstream.flush() returns EOF early for din.
           Product: D
           Version: 0.174
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: godaves yahoo.com

cstream.flush() returns EOF before an entire din stream is read for large files
on Windows. The problem seems to be with the DMC library fread/fflush routines.
This is not an issue on Linux.

import std.cstream, std.conv, std.stream;

void main()
    int    sum;
    char[] bufr = new char[128];
    char[] line;

    BufferedStream bsi = new BufferedStream(din,4096);
        line = bsi.readLine(bufr);
        if(line.length) sum += toInt(line);


test data:

(note: the test data is concatenated 8000 times and then redirected into

Nov 16 2006