Re: Re: STDIN Stream Query
| From: | Jason Freeman | Date: | Fri, 17 Aug 2007 14:45:39 +0000 |
| Subject: | Re: Re: STDIN Stream Query | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-260962@lists.php.net to get a copy of this message | ||
Per Jessen wrote:
Jason Freeman wrote:This is true which is why I put fread() into a loop. If you look at the output you will see that data is available even before the first iteration. PHP only seems to recognize this though when the enter key is pressed. If I press the enter key while blocking is off then it finds the data. Is there any way to get the PHP to recognize that data is available without pressing the enter key?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