#46422 [Bgs]: php cli's interactive mode BLOCKs while using a fifo
| From: | i at iii dot dontexist dot net | Date: | Wed, 29 Oct 2008 18:25:48 +0000 |
| Subject: | #46422 [Bgs]: php cli's interactive mode BLOCKs while using a fifo | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-130287@lists.php.net to get a copy of this message | ||
ID: 46422
User updated by: i at iii dot dontexist dot net
Reported By: i at iii dot dontexist dot net
Status: Bogus
Bug Type: CGI related
Operating System: Centos 5
PHP Version: 5.2.6
New Comment:
jani, thanks for the very fast response.
Unfortunately, I been googling for several days, and consulted 2 very
populated IRC channels.
you responded: "This is not a bug".
which means.... what?
1. Environmental issue on my side?
2. Intentional feature of php cli?
Unless I've failed to understand what "Interactive mode" means.. I
cannot see how this could possibly be the expected behavior?
Thanks a lot for the clarification.
Previous Comments:
------------------------------------------------------------------------
[2008-10-29 18:09:06] jani@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
------------------------------------------------------------------------
[2008-10-29 17:14:25] i at iii dot dontexist dot net
Description:
------------
Hello, I would like to use "php -a" (php cli interactive mode) and
input via a fifo.
it seems that while using it with a Character Device / Terminal.
it will behave accordingly.
but while piping its stdin .. it won't interact - it will block its
stdout.
due to the fact it is an interactive mode, I can only assume its a
misbehavior, I wouldn't expect interactive mode to block.
Reproduce code:
---------------
1. mkfifo fifo
2. cat fifo | strace php -a
3. cat > fifo
<?php echo "Hello World"; ?>
4. strace will reveal it been read, but nothing will be written back
unless about 8K buffer stack is full, or EOF.
Expected result:
----------------
I expect "interactive mode" not to block while piping its STDIN.
(without a Character Device / Terminal)
Actual result:
--------------
It would block unless EOF reached OR about 8K buffer is filled up.
and only then, it will write back to stdout.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=46422&edit=1