[fpc-pascal] Redirecting input to a child process
ludo.brands at free.fr
Mon May 9 09:04:57 CEST 2011
> Yes. It works now.
> Does this mean that the Windows implementation of TProcess should be
> using DuplicateHandle?
You can file a bug at http://bugs.freepascal.org/ . Dupicating handles isn't
apparently the only solution. The msdn sample creates non-inheritable pipes
and hands these handles simply over to createprocess, without duplicating.
You want to pass inheritable handles if you want the child to have full
control of the pipe, which apparently isn't needed for RW.
Note also that in most applications where you are in control (the
development I mean) of both sides of the pipe, you would use more robust
process control mechanisms than waiting for EOF.
De : fpc-pascal-bounces at lists.freepascal.org
[mailto:fpc-pascal-bounces at lists.freepascal.org] De la part de Anton
Envoyé : lundi 9 mai 2011 00:22
À : fpc-pascal at lists.freepascal.org
Objet : Re: [fpc-pascal] Redirecting input to a child process
> I'll try duplicating the handles and report the results.
Yes. It works now. I am creating a non-inheritable handle using
CreatePipe, then duplicating it to an inheritable one
using DuplicateHandle and pass the duplicate to the
Does this mean that the Windows implementation of TProcess should be
rewritten using DuplicateHandle?
Thanks everybody for your help.
fpc-pascal maillist - fpc-pascal at lists.freepascal.org
More information about the fpc-pascal