|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25429 copy() of stdin doesn't work any longer
Submitted: 2003-09-08 05:20 UTC Modified: 2003-09-09 20:58 UTC
From: devik at cdi dot cz Assigned: wez (profile)
Status: Closed Package: Filesystem function related
PHP Version: 4.3.3 OS: linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
7 + 8 = ?
Subscribe to this entry?

 [2003-09-08 05:20 UTC] devik at cdi dot cz
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:

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


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-09-09 20:58 UTC]
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
In case this was a documentation problem, the fix will show up soon at

In case this was a website problem, the change will show
up on the site and on the mirror sites in short time.
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Fri Jan 27 06:05:52 2023 UTC