Error in std.stdio.d

Jonathan M Davis via Digitalmars-d digitalmars-d at puremagic.com
Sat Aug 1 23:31:34 PDT 2015


On Sunday, 2 August 2015 at 06:01:01 UTC, MGW wrote:
> Error in std.stdio.d
> 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);
> }
>
> 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().

Please report the issue at https://issues.dlang.org if you have 
not already.

- Jonathan M Davis


More information about the Digitalmars-d mailing list