Pipe handles can be used directly with readfile:
Var BytesRead:Longword;
windows.Readfile(mProcess.Output.Handle,str1[1],BytesAvailable,BytesRead,nil
);
can replace
mProcess.OutPut.Read(str1[1], BytesAvailable);
Ludo
-----Message d'origine-----
De : [email protected]
[mailto:[email protected]] De la part de Anton
Shepelev
Envoyé : dimanche 8 mai 2011 22:26
À : FPC-Pascal users discussions
Objet : Re: RE : RE : [fpc-pascal] Redirecting input to a child process
Ludo Brands:
> > Connected with this remark, is there a way to get the underlying
> > StdIn handle in a FreePascal program, so as to read from it
> > per-character, or any other way using the OS's routines?
>
> The handles are mProcess.Input.Handle and mProcess.Out- put.Handle
I meant the program's own handles. Like instead of doing:
Read(input, c);
read directly from a handle:
Windows.ReadFile(inputHandle, ...);
Anton
_______________________________________________
fpc-pascal maillist - [email protected]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
_______________________________________________
fpc-pascal maillist - [email protected]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal