Page 1 of 1

Terminate exec() Program

Posted: Sun Aug 27, 2006 10:27 am
by ashrust
Hi,

I am running a lot of scripts concurrently for a real time application. I am using the exec() function to do this.

Is there a way of knowing when these programs are finished operating and how can I terminate them, once they have begun?

thanks in advance.

ash

Posted: Sun Aug 27, 2006 10:33 am
by Weirdan
take a look at proc_* functions

Posted: Sun Aug 27, 2006 10:42 am
by ashrust
does proc_open execute the command in the same way exec does. in the manual, it appears to suggest exe executes programs in a different manner.

Also can a program opened with proc_open terminate itself? If so how?

thanks

ash

Posted: Sun Aug 27, 2006 10:51 am
by Chris Corbyn
ashrust wrote:does proc_open execute the command in the same way exec does. in the manual, it appears to suggest exe executes programs in a different manner.

Also can a program opened with proc_open terminate itself? If so how?

thanks

ash
You can get the PID with those functions, and as thus, you can call `kill' to terminate them. You can also form pipes to keep in contact with a process once it has been started.