Spawning a process: Can I "have my cake and eat it too"?

Vladimir Panteleev thecybershadow.lists at gmail.com
Fri Mar 2 07:14:18 UTC 2018


On Friday, 2 March 2018 at 04:50:06 UTC, Nick Sabalausky 
(Abscissa) wrote:
> Launch a process (spawnProcess, pipeShell, etc) so the child's 
> stdout/stderr go to the parent's stdout/stderr *without* the 
> possibility of them getting inadvertently 
> reordered/reinterleaved when viewed on the terminal, *and* 
> still allow the parent to read the child's stdout and stderr?

I think it's possible on Linux.
1. Disable buffering on the pipe (see stdbuf etc.)
2. Fake output type to fool isatty (e.g. script -c 'child_program 
args...' /dev/null)



More information about the Digitalmars-d-learn mailing list