Re: Piping and the CLI parser

From: Date: Wed, 06 Aug 2003 14:45:49 +0000
Subject: Re: Piping and the CLI parser
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-158484@lists.php.net to get a copy of this message
On Wednesday 06 August 2003 22:35, Curt Zirzow wrote: > pipe.php: > $fp = fopen("php://stdin", "r"); > while (!feof($fp) ) { > print "piped: " . fgets($fp); > } > > % dir | php pipe.php > > results: > piped: total 42 > piped: drwxr-xr-x 12 curt www 512 Aug 6 14:31 ./ > piped: drwxr-xr-x 3 curt www 512 Aug 2 13:58 ../ Like the OP said, piping to STDIN works as expected. However the OP was wondering why the piped stuff did not appear in $argv. -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * ------------------------------------------ Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general ------------------------------------------ /* Man is a military animal, glories in gunpowder, and loves parade. -- P.J. Bailey */

« previous php.general (#158484) next »