From: devik at cdi dot cz
Operating system: linux
PHP version: 4.3.3
PHP Bug Type: Filesystem function related
Bug description: copy() of stdin doesn't work any longer
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 bug report at http://bugs.php.net/?id=25429&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=25429&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=25429&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=25429&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=25429&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=25429&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=25429&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=25429&r=support
Expected behavior: http://bugs.php.net/fix.php?id=25429&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=25429&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=25429&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=25429&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=25429&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=25429&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=25429&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=25429&r=gnused