#21815 [Asn->Csd]: Buffer loss with fpassthru on popen
| From: | wez@php.net | Date: | Thu, 13 Feb 2003 01:26:31 +0000 |
| Subject: | #21815 [Asn->Csd]: Buffer loss with fpassthru on popen | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-32934@lists.php.net to get a copy of this message | ||
ID: 21815
Updated by: wez@php.net
Reported By: stefan@fostam.franken.de
-Status: Assigned
+Status: Closed
Bug Type: Filesystem function related
Operating System: Linux 2.4
PHP Version: 4.3.0
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.
Fix will be in PHP 4.3.1, due soon.
Previous Comments:
------------------------------------------------------------------------
[2003-01-22 04:53:47] wez@php.net
I know what the problem is -> assigning to myself
------------------------------------------------------------------------
[2003-01-22 04:01:43] stefan@fostam.franken.de
When calling fpassthru() on a file pointer opened with popen(), it
fails if there has been already read from that pointer.
$fp = popen("/bin/ls /", "r");
if ($fp) {
$line = fgets($fp, 1024);
print $line;
fpassthru($fp);
}
Results in the following error:
fpassthru(): 77 bytes of buffered data lost during conversion to
FILE*!
The same script works fine with php 4.2.3. It also works fine if there
hasn't been read from the file before (i.e. omitting the fgets() line
in above example).
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=21815&edit=1