Re: STDIN Stream Query
| From: | Per Jessen | Date: | Thu, 16 Aug 2007 15:05:30 +0000 |
| Subject: | Re: STDIN Stream Query | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-260921@lists.php.net to get a copy of this message | ||
Jason Freeman wrote:
> Hi All
>
> I am having a problem getting stream_set_blocking to work the way I
> expect on STDIN. Please could someone tell me why while blocking is
> set to false fread does not get anything.
When a file descriptor (stdin) is non-blocking, any read() will not
block and wait for data to become available, but will return right away
with or without data. Set the fd to blocking to wait for data.
/Per Jessen