[fpc-pascal] TProcess on windows: incompatibility between poUsePipes and InheritHandles:=false

Luca Olivetti luca at ventoso.org
Fri Mar 14 17:36:30 CET 2014


El 13/03/14 00:21, Luca Olivetti ha escrit:
> El 11/03/14 19:43, Luca Olivetti ha escrit:
> 
>>> I have no explicit solution for you, but a few links that I hope can
>>> help you further:
>>>
>>> http://blogs.msdn.com/b/oldnewthing/archive/2011/12/16/10248328.aspx
>>
>> What surprises me is that it says that handles by default are
>> non-inheritable
> 
> It turns out that sockets by default *are* inheritable, but that doesn't
> really work reliably, and at the same time you *cannot* stop them from
> being inheritable
> 
> http://stackoverflow.com/questions/12058911/can-tcp-socket-handles-be-set-not-inheritable
> 
> Now I know that windows has been designed by Vicky Pollard.

Since, in this case, I have control over the spawned program, I just
modified it to send its results to an UDP socket instead of standard
output, passing the port to use as a command line argument, so I can
avoid poUsePipes and set InheritHandles to false.
The workarounds in the link above can be used when you cannot modify the
program.

Bye
-- 
Luca



More information about the fpc-pascal mailing list