note 23224 deleted from function.fgetc by didou
| From: | didou@php.net | Date: | Thu, 08 Jan 2004 21:17:32 +0000 |
| Subject: | note 23224 deleted from function.fgetc by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-63171@lists.php.net to get a copy of this message | ||
Note Submitter: pizza@parseerror.com
----
i am using this example, which may or not be properly implemented. i'm running Redhat Linux 7.3
with the php standalone (cgi) version 4.1.2.
$f = fopen("php://stdin", "r+");
set_file_buffer($f, 0);
while(($c = fgetc($f)) != 'X') {
fputs($f, $c); fclose($f);
}
i would think it would echo each typed char unless it was 'X'. it still waits for a \n,
but now returns the entire line. this makes things like tab-completion and other neat cmdline tricks
undo-able, unless i'm missing something obvious. which is, of course, very possible.