proc_get_status command

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Carol
Forum Newbie
Posts: 2
Joined: Sun Apr 18, 2004 9:47 pm
Contact:

proc_get_status command

Post by Carol »

I read in PHP manual about proc_get_status command but I can not use it. Could you give me any example about it. Thanks very much.
Also, do you know how to know what processes are running on Window platform?
Thanks again.
Carol
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

hm, may be something like:

Code: Select all

$descriptorspec = array(
   0 => array("pipe", "r"),  // stdin is a pipe that the child will read from
   1 => array("pipe", "w"),  // stdout is a pipe that the child will write to
   2 => array("file", "/tmp/error-output.txt", "a") // stderr is a file to write to
);
$process = proc_open("some_program.exe", $descriptorspec, $pipes);
if (is_resource($process)) {
  var_dump(proc_get_status($process));
  proc_close($process);
}
Also, do you know how to know what processes are running on Window platform?
if you have Resource Kit installed on your win box, then something like this is possible:

Code: Select all

echo `tlist`;
Basically, tlist is the console tool intended to show the list of tasks currently beeing executed. Backtick operator are used here to catch the output of this program.
Post Reply