note 95767 added to function.popen

From: Date: Thu, 21 Jan 2010 02:26:56 +0000
Subject: note 95767 added to function.popen
Groups: php.notes 
Request: Send a blank email to php-notes+get-165151@lists.php.net to get a copy of this message
Note that you *have* to do a read on the handle before you can feof(), even if the command outputs nothing! So.. <?php $f=popen("sleep 2","r"); while (!feof($f)) {} pclose($f); print "done"; ?> will never finish. ---- Server IP: 69.147.83.197 Probable Submitter: 174.46.204.210 ---- Manual Page -- http://www.php.net/manual/en/function.popen.php Edit -- https://master.php.net/note/edit/95767 Del: integrated -- https://master.php.net/note/delete/95767/integrated Del: useless -- https://master.php.net/note/delete/95767/useless Del: bad code -- https://master.php.net/note/delete/95767/bad+code Del: spam -- https://master.php.net/note/delete/95767/spam Del: non-english -- https://master.php.net/note/delete/95767/non-english Del: in docs -- https://master.php.net/note/delete/95767/in+docs Del: other reasons-- https://master.php.net/note/delete/95767 Reject -- https://master.php.net/note/reject/95767 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#165151) next »