Re: Problem with getting non-blocking data from stdin
| From: | Robert Cummings | Date: | Sat, 20 Sep 2003 06:03:30 +0000 |
| Subject: | Re: Problem with getting non-blocking data from stdin | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-163281@lists.php.net to get a copy of this message | ||
On Sat, 2003-09-20 at 02:02, Curt Zirzow wrote:
> hmm.. on second thought...
>
> * Thus wrote Robert Cummings (robert@interjinn.com):
> > [...]
> > if( ($char = fread( $stdin, 1 )) !== false )
>
> How are you calling this script? I'm not sure how cgi will handle
> fread <stdin>
>
> With a traditional CGI script <stdin> is what is read on POST data
> from a form, and php takes care of this.
>
> That is where my confusion is now.
I'm calling it as "php -qC foo.php". The fread() should work since it
works on input when I don't have stdin in non-blocking mode. Perhaps
it's a bug. I took a look at the doc on streams again, and it uses
php://input as the POST stream. Maybe it's a bug.
Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com
|
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'