On Monday, 11 December 2017 at 22:58:53 UTC, Jordi Gutiérrez Hermoso wrote:
On Monday, 11 December 2017 at 21:21:51 UTC, Steven Schveighoffer wrote:
Use the undead repository:

Wow, really? Is the removal of stream from D some kind of error that hasn't been corrected yet?

Well of course you can use ranges for it, see e.g. this simple example:

---
void main(string[] args)
{
    import std.conv, std.range, std.stdio;
foreach (d; File(__FILE_FULL_PATH__).byChunk(4096).join.take(5)) {
        writefln("%s", d.to!char);
    }
}
---

Run here: https://run.dlang.io/is/Ann9e9

Though if you need superb performance, iopipe or similar will be faster.

Reply via email to