Pelle MÃ¥nsson:
> foreach (line; open("foobar.txt")) {
> writeln(line);
> }
With the xio module of my dlibs:
import d.xio: xfile;
foreach (line; xfile("foobar.txt"))
putr(line);
xfile is optimized to reduce memory rellocations as much as possible in the most common case of about 90 chars long lines.
There is an xstdin too.
Bye,
bearophile