ID: 44908
User updated by: mike at silverorange dot com
Reported By: mike at silverorange dot com
-Status: Feedback
+Status: Open
Bug Type: Streams related
Operating System: Windows
PHP Version: 5.2.6
Assigned To: fb-req-jani
New Comment:
Jani,
I'm using the MSI install of PHP 5.2.6 (cli) (built Apr 30 2008
16:19:00) on Windows XP Home with Service Pack 2.
Previous Comments:
------------------------------------------------------------------------
[2008-05-04 21:50:20] [EMAIL PROTECTED]
Please check the used PHP version. (phpinfo(); usually is the best way)
------------------------------------------------------------------------
[2008-05-04 08:08:55] mike at silverorange dot com
Edit:
Actual result:
--------------
The _write_ array contains stdin and the _read_ array contains stdout
and stderr. The stdout and stderr streams have no data ready and fread()
will block indefinitely.
------------------------------------------------------------------------
[2008-05-04 08:06:11] mike at silverorange dot com
Description:
------------
When using stream_select() on pipes returned by proc_open() in Windows,
input streams that are not ready are returned in the modified $read
array.
Reproduce code:
---------------
<?php
$pipes = array();
$proc = proc_open('c:/progra~1/gnu/gnupg/gpg.exe', array(
0 => array('pipe', 'r'),
1 => array('pipe', 'w'),
2 => array('pipe', 'w')), $pipes, null, $_ENV);
if ($proc !== false) {
$write = array($pipes[0]);
$read = array($pipes[1], $pipes[2]);
$except = null;
$changed = stream_select($read, $write, $except, null);
if ($changed) {
print_r($read);
print_r($write);
}
proc_close($proc);
}
?>
Expected result:
----------------
The read array will be empty and the write array will contain stdin.
Actual result:
--------------
The read array contains stdin and the write array contains stdout and
stderr. The stdout and stderr streams have no data ready and fread()
will block indefinitely.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=44908&edit=1