#25429 [Asn->Csd]: copy() of stdin doesn't work any longer
| From: | iliaa@php.net | Date: | Wed, 10 Sep 2003 00:58:26 +0000 |
| Subject: | #25429 [Asn->Csd]: copy() of stdin doesn't work any longer | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-47355@lists.php.net to get a copy of this message | ||
ID: 25429
Updated by: iliaa@php.net
Reported By: devik at cdi dot cz
-Status: Assigned
+Status: Closed
Bug Type: Filesystem function related
Operating System: linux
PHP Version: 4.3.3
Assigned To: wez
New Comment:
This bug has been fixed in CVS.
In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.
In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2003-09-08 05:20:17] devik at cdi dot cz
Description:
------------
copy("/dev/stdin","/tmp/xx"); was working in 4.0.6 but in
4.3.3 it results in empty file. When I ran strace then I see
fstat64(2) used on handle 4 which is dup(2)ed from handle 0.
It results to fs_size==0 and code in php_stream_copy_to_stream
(IIRC) hapily creates zero-sized file (immeditely - no wait for EOF).
With PHP fopen() it works as expected (it waits).
Reproduce code:
---------------
copy("/dev/stdin","/tmp/xx");
Expected result:
----------------
to stop on copy() and wait to EOF and then have input in /tmp/xx
Actual result:
--------------
copy() passes and /tmp/xx is zero-length file
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=25429&edit=1