[fpc-pascal] Redirecting input to a child process

Ludo Brands ludo.brands at free.fr
Mon May 9 09:04:57 CEST 2011


> Yes.  It  works  now.
Great.

> Does this mean that the Windows implementation  of  TProcess should be
rewritten 
> 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. 
 


-----Message d'origine-----
De : fpc-pascal-bounces at lists.freepascal.org
[mailto:fpc-pascal-bounces at lists.freepascal.org] De la part de Anton
Shepelev
Envoyé : lundi 9 mai 2011 00:22
À : fpc-pascal at lists.freepascal.org
Objet : Re: [fpc-pascal] Redirecting input to a child process


I wrote:

> 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
CreateProcess funtion.

Does this mean that the Windows implementation  of  TProcess should be
rewritten using DuplicateHandle?

Thanks everybody for your help.
Anton
_______________________________________________
fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal




More information about the fpc-pascal mailing list