ID:               44908
 User updated by:  mike at silverorange dot com
 Reported By:      mike at silverorange dot com
 Status:           Open
 Bug Type:         Streams related
 Operating System: Windows
 PHP Version:      5.2.6
 New Comment:

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.


Previous Comments:
------------------------------------------------------------------------

[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

Reply via email to