How to get output of piped process?
Danny Arends
Danny.Arends at gmail.com
Wed Mar 3 20:43:54 UTC 2021
On Monday, 22 February 2021 at 14:52:22 UTC, frame wrote:
> On Monday, 22 February 2021 at 13:23:40 UTC, Danny Arends wrote:
>
>> https://github.com/DannyArends/DaNode/blob/master/danode/process.d
>>
>> Danny
>
> This example shows how easy it is to implement a non-blocking
> stream. Phobos knows this for sockets but not for pipes?
Sockets seem to be more OS independent and are way more mature in
Phobos.
Pipes seem to have been added as an afterthought in std.process
and std.stdio
I had to add code for windows to deal with non-blocking/buffering
pipes, Linux uses fcntl/fileno to enable non-blocking
No idea why non-blocking pipes aren't in Phobos, but pipes should
not be an afterthought but a first class citizen imho
More information about the Digitalmars-d-learn
mailing list