Re: Piping and the CLI parser

From: Date: Wed, 06 Aug 2003 14:35:46 +0000
Subject: Re: Piping and the CLI parser
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-158477@lists.php.net to get a copy of this message
* Thus wrote Nicolas Frisby (kotsu@ku.edu): > > Is my suspicion that the CLI php parser does not set up STDIN to receive > from a pipe correct, or am I missing something here? I think the problem might be DOS's attempt to do a real pipe. > > pps - if someone could try similar piping on a *nix box, I'd be interested > to know how that goes 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 ../ ... Curt -- "I used to think I was indecisive, but now I'm not so sure."

« previous php.general (#158477) next »