note 25691 added to function.popen
| From: | martin at semester dot sk | Date: | Wed, 02 Oct 2002 13:21:27 +0000 |
| Subject: | note 25691 added to function.popen | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-37544@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 ?
--
http://www.php.net/manual/en/function.popen.php
http://master.php.net/manage/user-notes.php?action=edit+25691
http://master.php.net/manage/user-notes.php?action=delete+25691
http://master.php.net/manage/user-notes.php?action=reject+25691