-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 06.04.2013 19:12, Marc Hoersken wrote: > Hi LRN, > > 2013/4/6 LRN <lrn1...@gmail.com>: >> You can use Win32API Perl module and TerminateProcess or >> SafeTerminateProcess. Also, CreateJobObject + >> AssignProcessToJobObject can be used to implement behaviour >> similar to kill -<pid>. Obviously, that also requires Win32API >> module. > > I added support for Windows XP by also using tskill to terminate > the process. I personally don't like the idea of adding new > third-party Perl modules with Windows API dependencies, unless it's > a requirement. Any objections? The only advice i can give is to treat tskill failures gracefully. W32 is known to put processes into a state in which they still exist, but cannot be interacted with, probably due to the fact that OS is dismantling them at the moment. Killing such process at that time will fail with "Access denied", no matter who you are or what permissions you have. If that happens, i'd advise to wait for a second or two (the best way is to wait on process termination, but that requires Win32API; you can instead just wait for short amounts of time in a loop, then check whether the process is dead; or just wait for the full amount of time, if performance is not a goal), then check if the process is still alive and try again if it still is.
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (MingW32) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBAgAGBQJRYD70AAoJEOs4Jb6SI2CwTL0H/jnPMHplHvKkV7PAgB3hL7Ir GNDqtvUW8y+vWZBCWd3NQkBvnIwsg2JrkydYcTS7O4X7UaaSvh4pF0NJwQ0fg/Q2 uzfaffrZNPyi6E8PPt6IAuEVXWxP7T112ZB32XQbs+CMncSxjPDqNxLL/HU6M0Bx IebnjSFir/X4dzfKVJDcVKyACiP/ZAn9An1LCizn8axPpOCnjTM2iheIlGHqaUYX XlJiUnBulmOGOjldk4SxUImiF3dSOeZ7uue8xg55nROnGwHIh/9IGuFlL7S9/+qv 4Bl9gOA+wATt+0AjS36gIw/EIlu1xEf1wnUAUApSNUMjdlAERfB0KYakGw5wfhY= =37B/ -----END PGP SIGNATURE----- ------------------------------------------------------------------- List admin: http://cool.haxx.se/list/listinfo/curl-library Etiquette: http://curl.haxx.se/mail/etiquette.html