in reply to break thread with system(...) call
Without threads:
## Start the program asynchronously my $pid = system 1, "padprog.exe"; ## Wait for some period sleep $timeout; ## If program is still running, kill it kill 1, $pid if kill 0, $pid;
Be aware that if your command contains shell meta characters, then the pid will be for cmd.exe, not whatever exectuable it starts, and killing the shell won't normally kill the other process
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: break thread with system(...) call
by aaaone (Initiate) on Jul 16, 2008 at 19:19 UTC | |
by BrowserUk (Patriarch) on Jul 16, 2008 at 20:39 UTC | |
by BrowserUk (Patriarch) on Jul 17, 2008 at 13:12 UTC | |
by BrowserUk (Patriarch) on Jul 17, 2008 at 14:13 UTC | |
by aaaone (Initiate) on Jul 17, 2008 at 16:52 UTC |