From:             [EMAIL PROTECTED]
Operating system: Linux 2.4
PHP version:      4.3.0
PHP Bug Type:     Filesystem function related
Bug description:  Buffer loss with fpassthru on popen

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 bug report at http://bugs.php.net/?id=21815&edit=1
-- 
Try a CVS snapshot:         http://bugs.php.net/fix.php?id=21815&r=trysnapshot
Fixed in CVS:               http://bugs.php.net/fix.php?id=21815&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=21815&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=21815&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=21815&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=21815&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=21815&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=21815&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=21815&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=21815&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=21815&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=21815&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=21815&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=21815&r=gnused

Reply via email to