Open aminya opened 3 years ago
This package does not do buffering, it is strictly an abstraction of an i/o subsystem, and the basis of other packages which might do buffering or whatever else. If you want buffering, I'd suggest using iopipe which is built to work on top of this package, and provides a buffering system.
Your code basically says "read 0 bytes from the input", and then writes that empty buffer to stdout.
I couldn't find a simple example that allows me to read text from a file. I want to see if this library gives better performance over the following code that I have.
import std.file : readText, write;
const string str = readText(file);
const strModified = doThingsWithString(str);
write(file, strModified);
read and readText use the file size to preallocate the result. I doubt you get better performance by using a growing buffer. I also wouldn’t expect much performance difference with std.io if you did the same optimization.
How can I use this package with a growing buffer?
I tried a dynamic array, but it doesn't work