How can I gently kill a process in ActiveState Perl? -


do need use specific exitcode ?

win32::process::create(     $processobj,     "c:\\program files (x86)\\mozilla firefox\\firefox.exe",     "firefox -no-remote -p $prof_name",     0,     normal_priority_class, ".")|| die errorreport(); $processobj->kill(0); 

that way kills, not gently, generating problems firefox profile.

short   usual methods other window's taskkill forceful. mob , melpomene.


the win32::process documentation doesn't methods kill or killprocess do, seem pretty blunt it. windows provide gradation in how terminate process, see example post on graceful termination via winapi, not have unix's signals. however, apparently not utilized module nor kill (see end).

the windows's own taskkill should nicely ask process terminate. query flags, running taskkill /? in console on system. here documentation taskkill on ms technet. example, terminates process $pid, along children

my $pid = $processobj->getprocessid(); system("taskkill /t /pid $pid"); 

if method getprocessid() doesn't return real id, see link below other ways.

i can't test on windows right now. there's bit more related detail in this post, second part.


perl's kill apparently forceful on windows. perlport

... kill($sig, $pid) terminates process identified $pid, , makes exit exit status $sig.

thanks melpomene comment , documentation link.

the exitcode, believe, tells process report system exit.


Comments

Popular posts from this blog

wordpress - (T_ENDFOREACH) php error -

Export Excel workseet into txt file using vba - (text and numbers with formulas) -

Using django-mptt to get only the categories that have items -