I'm using this to start a tail -f like window on Win to visualize logged output of a background process
sub start_ps_tail { my ( $logfile ) = @_ ; print system <<"__CMD__"; start "MONITORING $logfile" cmd /c powershell gc -tail 10 -wait $l +ogfile __CMD__ }
problem is I need to be able to kill the sub-process again when the logfile stopped being open for writing (i.e. isn't locked anymore)
I though about sending a 'kill', but Perl doesn't seem to give me the PID.
My workaround for the time being is to rename the logfile, b/c powerhell will terminate the tail then, but my boss doesn't want that (though I could rename it back)
Any better ideas, there must be a way to kill a sub-process...
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
In reply to Killing subprocess in windows by LanX
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |