note 25691 rejected from function.popen by nicos
| From: | nicos@php.net | Date: | Wed, 02 Oct 2002 17:07:39 +0000 |
| Subject: | note 25691 rejected from function.popen by nicos | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-37557@lists.php.net to get a copy of this message | ||
It seems, if I execute command using popen function reading its output using fread, it is not done
interactively. Execution of popen function lasts until executed program hasn't terminated and
after that I can read whole programm's output.
For example running:
$fp = popen("echo a; sleep 1; echo b; sleep 1; echo c", "r");
while (!feof($fp))
{
echo fread($fp, 1024);
flush();
}
... will wait for a 2 seconds without any output to browser and after that whole output appears in
one moment.
Any idea how to amke it interactively ?