[phobos] std.stdio : ByChunk for File
Lars Tandle Kyllingstad
lars at kyllingen.net
Thu Aug 26 23:16:09 PDT 2010
I've been thinking some more about this, and I think you're right.
Creating an entirely new type for this one use case may be overkill. A
buffering-on/-off flag in File should suffice.
Another point worth noting is that we only need the input stream to not
be buffered. For the output and error streams, spawnProcess() would
just call flush() before passing them on to the child process.
Steven, do you have any comments?
-Lars
On Thu, 2010-08-26 at 22:14 -0700, Andrei Alexandrescu wrote:
> Regarding UnbufferedFile, I think we should sit down and analyze again
> what we want to achieve. I understand it's not easy to remember the
> buffering mode for a file once opened, but since File intercepts fopen()
> and setvbuf(), it should be easy to add a field to File that tells
> whether it uses buffering or not, and to set buffering upon opening the
> file. I don't think an entire new type is justified here.
>
> Andrei
>
> On 5/30/10 3:05 PDT, Lars Tandle Kyllingstad wrote:
> > I agree. That's what I did for UnbufferedFile, which I hope to add to
> > std.stdio:
> >
> > http://github.com/kyllingstad/ltk/blob/master/ltk/stdio.d
> >
> > -Lars
> >
> > _______________________________________________
> > phobos mailing list
> > phobos at puremagic.com
> > http://lists.puremagic.com/mailman/listinfo/phobos
More information about the phobos
mailing list