Jan, wuuuuuuauuuuu, :-))) exalent article. Thanx a lot.
Am 12 Aug 2003 um 12:29 hat Jan Dubois geschrieben: > On Tue, 12 Aug 2003 14:48:37 -0400, "Jean-Sebastien Guay" > <[EMAIL PROTECTED]> wrote: > > >He meant the perl function "kill". it should work on Win32 as well. > > Note that Perl 5.6 will always send a 'KILL' signal, i.e. > > kill 9, $pid; > or > kill 'KILL', $pid; > > regardless what signal you specify. > > Perl 5.8 has some support for the 'INT' signal on Windows, but > unfortunately you cannot send 'INT' (Ctrl-C) to process groups but only > single processes. Perl 5.8 started to always create new processes as > process groups, so > > kill 2, $pid; > or > kill 'INT', $pid; > > will not work if the process has been created by Perl itself. The > process group creation is necessary because Perl often starts child > processes via cmd.exe. If it wouldn't mark them as a process group, the > 'KILL' signal would only terminate the cmd.exe process but not the > _real_ child process. > > In Perl 5.8.1 it will be possible to send a 'BREAK' (Ctrl-Break) signal > to other processes, and that one does indeed work with process groups as > well. That will allow you to intercept the signal in the child process > and do your cleanup before terminating: > > $SIG{BREAK} = sub { > # shut down > exit(1); > } > > In summary: > > * kill() in Perl 5.6.x on Windows maps all signals to 'KILL'. > > * kill() in Perl 5.8.0 on Windows maps all signals except 'INT' > to 'KILL'. > > * kill() in Perl 5.8.1 on Windows will map all signals except 'INT', > 'BREAK' and 'TERM' to 'KILL'. It will also map 'TERM' to 'BREAK'. > > Cheers, > -Jan > > _______________________________________________ > ActivePerl mailing list > [EMAIL PROTECTED] > To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs Kris Wolff Application Developer dietzk. Interactive OHG Am Kirchplatz 41-43 D-65779 Kelkheim Fon +49 (0) 6195 72 42- 15 Fax +49 (0) 6195 72 42- 29 [EMAIL PROTECTED] http://www.dietzk.de _______________________________________________ ActivePerl mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs