[Issue 14861] New: Error in stdio.d in LockingTextReader.readFront()
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Sat Aug 1 23:22:21 PDT 2015
https://issues.dlang.org/show_bug.cgi?id=14861
Issue ID: 14861
Summary: Error in stdio.d in LockingTextReader.readFront()
Product: D
Version: D2
Hardware: x86
OS: Windows
Status: NEW
Severity: critical
Priority: P1
Component: phobos
Assignee: nobody at puremagic.com
Reporter: mgw at yandex.ru
This mistake, is result of wrong algorithm with reading from the ring buffer of
the file and return of the read symbols there in stdio function ungetc().
This example doesn't work!
// dmd 2.067.1 Win 32
import std.stdio;
void main(string[] args) {
File fw = File("panic.csv", "w");
for(int i; i != 5000; i++) fw.writeln(i, ";", "Иванов;Пётр;Петрович");
fw.close();
// Test read
File fr = File("panic.csv", "r");
int nom; string fam, nam, ot;
// Error format read
while(!fr.eof) fr.readf("%s;%s;%s;%s\n", &nom, &fam, &nam, &ot);
}
--
More information about the Digitalmars-d-bugs
mailing list