From:             xxmettedraqxx at comcast dot net
Operating system: windows xp
PHP version:      5.0.1
PHP Bug Type:     CGI related
Bug description:  php stdin control under windows dos prompt

Description:
------------
I'm not sure if non-blocking mode works under windows xp..

I can't seem to process anything while waiting for user input.. it's
possible that I just do not know how to code this in php and it is my
fault.  Although I searched for several days before posting this.

Can anyone help me out on this?

p.s. please email me if I don't respond.. I might loose track of this bug
if I'm not contacted in some way.

Thank you.

Reproduce code:
---------------
set_time_limit (0);
$fp_stdin = fopen("php://stdin", "rb");
stream_set_blocking($fp_stdin, false);
ob_implicit_flush ();

$input = get_line($fp_stdin);

function get_line($fp) {
  $input = "";
  $char = "";
  do {
    if (($char = @fread($fp,1)) !== false) {
      $input .= $char;
      if ($char == "\n") { break; }
      $char = "";
    } else {
      echo "testing..\n";
    }
  } while(true);
  return $input;
}; // end function get_line

Expected result:
----------------
I should be able to see the word testing until the user types something..
as in.. say I typed in "shutdown"..

then the program would exit... after testing my input..

the testing is a substitute for checking telnet connections to allow for
user input from the keyboard and at the same time run through other
processes.

Actual result:
--------------
it waits for user input.

-- 
Edit bug report at http://bugs.php.net/?id=30154&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=30154&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=30154&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=30154&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=30154&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=30154&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=30154&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=30154&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=30154&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=30154&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=30154&r=notwrong
Not enough info:             http://bugs.php.net/fix.php?id=30154&r=notenoughinfo
Submitted twice:             http://bugs.php.net/fix.php?id=30154&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=30154&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=30154&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=30154&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=30154&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=30154&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=30154&r=float
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=30154&r=mysqlcfg

Reply via email to