From: "Berger, Daniel" Date: 2005-09-22T06:39:59+09:00 Subject: Re: signals and win32 > -----Original Message----- > From: Ara.T.Howard [mailto:Ara.T.Howard@noaa.gov] > Sent: Wednesday, September 21, 2005 9:00 AM > To: ruby-talk ML > Subject: Re: signals and win32 > > basically i'm doing this in one irb session > > irb > Process::pid > 1234 > irb > trap(2){ STDERR.puts "got 2"} > > and then, in another command window > > irb > require 'win32/process' > irb > Process::kill 2, 1234 > > but this doesn't work. of course i've tried with scripts too > in order to make sure irb didn't have some signal handlers of > it's own. i always end up getting errors from the kill or, > if the kill works, the trap does not: the other process > simply exits no matter what - eg. trap doesn't seem to work. > > hope that is enough info - i'm away from that machine right now. > > cheers. > > -a Oh, right, now I remember. The problem is that signals 2 and 3 will only be caught on processes created, via CreateProcess(), with the CREATE_NEW_PROCESS_GROUP flag. This is, unfortunately, just the way that GenerateConsoleCtrlEvent() works. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc /base/generateconsolectrlevent.asp So, I'm guessing that in most cases, it's not very useful. Regards, Dan