On Fri, Nov 04, 2011 at 05:30:30PM -0700, Sean P. DeNigris wrote:
David T. Lewis wrote:
You can kill the external process with a unix signal like this: p processProxy terminate.
Cool, thanks.
David T. Lewis wrote:
However, in general, it is better to permit the external process to exit normally.
Better how? On the Unix side, or the Squeak side?
David T. Lewis wrote:
Note that it is entirely possible to send the exact equivalent of ctrl-c (which is a unix SIGINT signal sent to the process)
I'll have to take a look. I was asking because I am calling Mac OS X's hdiutil, which can take ~5-10 minutes to run, and sometimes I want to cancel the op. I mentioned Ctrl-c specifically because I know it responds to it; on the CLI, it gives a message about canceling before stopping.
In that case, try doing something more like this:
p := PipeableOSProcess command: '/bin/sh'. p processProxy sigint.
But use hdiutil rather than the /bin/sh that I use in the above example. The #sigint message will send a unix SIGINT signal to the external process, which should be exactly equivalent to doing ctrl-c if you were running hdiutil from a terminal window on the Mac (but I do not actually have a Mac, so I might be getting the details wrong).
Dave