php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #25933 stream_select
Submitted: 2003-10-21 08:30 UTC Modified: 2004-08-19 13:48 UTC
From: flape at pobox dot sk Assigned: aidan (profile)
Status: Closed Package: Documentation problem
PHP Version: 4.3.3 OS: Win2K
Private report: No CVE-ID: None
 [2003-10-21 08:30 UTC] flape at pobox dot sk
Description:
------------
stream_select aplied on a file handle - that is told to be a stream too - emiadelly returns.

Reproduce code:
---------------
<?
$fh = fopen('debug.txt','r+');
stream_set_blocking($fh ,false);
$ra = array($fh);
while(true){  
  while(0 == stream_select($ra,$w = NULL,$e = NULL,20))
  $text = fgets($fh,10);
  echo $text;

  flush();
  ob_flush();

}
fclose($fh);
?>


Expected result:
----------------
It should prit the context of debug.txt and everithing what was added to that file after starting the script.

Actual result:
--------------
Warning: stream_select(): unable to select [0]: No error in c:\temp\htdocs\debug.php on line 7

Patches

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-11-04 03:45 UTC] wez@php.net
It should work with file handles.
Try removing the stream_set_blocking() call: stream_select() will give you an indication if an operation would block - if it is set to non-blocking, it is possible that your OS is telling you it has nothing to do.

 [2003-11-05 10:05 UTC] flape at pobox dot sk
I've done it in blocking and even in non-blocking mode with the same result
 [2003-11-28 17:32 UTC] wez@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5-win32-latest.zip

Can you try using a PHP *5* snapshot (dated today)?
If it works in PHP 5, I can port the changes down to PHP 4; otherwise, I don't think it will be possible to select on files under win32.
 [2003-12-04 02:23 UTC] sniper@php.net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.


 [2004-03-04 11:44 UTC] flape at pobox dot sk
I experience the same problem even With 4.3.5RC4-dev.
 [2004-03-04 12:00 UTC] flape at pobox dot sk
With newest php5 snap I got:

Warning: stream_select() [function.stream-select]: unable to select [0]: No error (max_fd=0)
 [2004-03-06 07:31 UTC] flape at pobox dot sk
Even if the files weren't selectable on Wins, it could be done anyway. good file editors notice, when the file, that is open in it, has been changet by another process...
 [2004-03-08 06:35 UTC] sniper@php.net
Wez said:
"If it works in PHP 5, I can port the changes down to PHP 4; otherwise, I don't think it will be possible to select on files under win32."

It doesn't work -> it's not possible.

 [2004-08-19 13:46 UTC] aidan@php.net
This should be documented under stream_select as a compatability issue.
 [2004-08-19 13:48 UTC] aidan@php.net
This bug has been fixed in the documentation's XML sources. Since the online and downloadable versions of the documentation need some time to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Aug 17 14:01:27 2024 UTC