import std.string;
import std.stdio;
void main( ){
File tmp = File.tmpfile();
tmp.writeln( "ok" );
tmp.writeln( "D is Fun" );
writefln( "fileName: %s", tmp.name );
foreach( line; tmp.byLine() )
writefln( "l: %s", line );
}
...
why i can not iterate over line?
You can, but the file is still open and you are at the end of the file.
Try:
tmp.rewind;
foreach( line; tmp.byLine() )
writefln( "l: %s", line );
