piping processes

Andrej Mitrovic andrej.mitrovich at gmail.com
Thu Dec 1 04:07:12 PST 2011

On 12/1/11, Regan Heath <regan at netmail.co.nz> wrote:
> I know these are basic examples, but I think in RedirectChildHandle.d,
> CreateChildProcess, you should (ideally) be closing childStdoutWrite and
> childStdinRead /after/ CreateProcess.  If you don't you get 2 copies of
> them, one in the child and one in the parent.  If the child closes it's
> copy the parent will not notice the pipe close (when reading from the
> other end of the pipe - for example).  If you close it, it will mean that
> you will actually drop out of a blocking read in the parent immediately
> (when the child terminates), rather than timing out and then discovering
> the child has terminated (using the thread or process handle).

That example comes straight from MSDN's documentation, although I
might have made some modifications. Thanks for the info though, I'll
see about fixing it.

More information about the Digitalmars-d-learn mailing list