note 80550 added to function.system

From: Date: Tue, 22 Jan 2008 03:37:54 +0000
Subject: note 80550 added to function.system
Groups: php.notes 
Request: Send a blank email to php-notes+get-135300@lists.php.net to get a copy of this message
If you are writing CLI scripts in PHP and call external programs which produce some kind of progress bar you should really use passthru() for the output of the external program to go to the terminal immediately. Such progress bar are usually done by outputing the string with "\r" at the end, and contain no "\n". system() and friends look for "\n" before flushing the buffer. As a result, you see nothing during the lengthy operation and suddenly you get the 100% reading, because all output was buffered and quickly replayed into the terminal when the final "\n" has been seen. ---- Server IP: 195.54.192.44 Probable Submitter: 84.19.182.242 ---- Manual Page -- http://www.php.net/manual/en/function.system.php Edit -- https://master.php.net/note/edit/80550 Del: integrated -- https://master.php.net/note/delete/80550/integrated Del: useless -- https://master.php.net/note/delete/80550/useless Del: bad code -- https://master.php.net/note/delete/80550/bad+code Del: spam -- https://master.php.net/note/delete/80550/spam Del: non-english -- https://master.php.net/note/delete/80550/non-english Del: in docs -- https://master.php.net/note/delete/80550/in+docs Del: other reasons-- https://master.php.net/note/delete/80550 Reject -- https://master.php.net/note/reject/80550 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#135300) next »