Re: Unable to terminate a child process on Windows
Camille,
My experience using sys:open-pipe on Windows is that is a very blunt force approach to interacting with another process. The only way to interact with the process is through the bidirectional stream returned by open-pipe. This means you have to understand the idiosyncrasies of the process you are interacting with. In my specific case, I can send a command to the process, but it wont execute until I've read all of the output generated for the bidirectional stream. When I send the process it's "exit" command, again, the process does not actually close until all of the output has been read. So, using this process with open-pipe required me to learn more about the input/output buffering behavior of the process than I really ever cared to know. This behavior is process specific, because when I initially experimented with open-pipe, I used gnuplot as the test process and it did not require any of the output to be read to execute new commands or close.
If you really need as fine control as your post suggests, you probably need to get familiar with the FLI. I would take this approach with the process of my example, except that it is a legacy Fortran process and I'm not confident that I would be able to use the FLI to interface with Fortran code. With WIN32 libraries I think you'll have much better luck.
Hope that helps,
Tom
----------------------------------------------------------------
Thomas M. Hermann
Odonata Research LLC
http://www.odonata-research.com/
http://www.linkedin.com/in/thomasmhermann
On Thu, Jun 9, 2011 at 2:42 AM, Camille Troillard
<camille@osculator.net> wrote:
Hello,
On Windows, I would like to know if sys:open-pipe sets the PROCESS_TERMINATE flag when calling OpenProcess.
It seems child processes I spawn using sys:open-pipe do not respond to termination events. I need a way to signal child processes and stop via system calls.
Best Regards,
Camille