#21120 [NEW]: fflush doesn`t work
| From: | rashid@php.net | Date: | Fri, 20 Dec 2002 22:01:39 +0000 |
| Subject: | #21120 [NEW]: fflush doesn`t work | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-28124@lists.php.net to get a copy of this message | ||
From: rashid@php.net
Operating system: win2k pro
PHP version: 4.2.3
PHP Bug Type: Filesystem function related
Bug description: fflush doesn`t work
this is not the same as
http://bugs.php.net/bug.php?id=19711 :)
the following code on my platform displays:
File size: 0, written: 2890
File size: 2890, written: 2890
as far as i know fflush should flush output to file at the moment of
calling :] moving the line with flcose to the end of script causes that
also the second display shows
File size: 0, written: 2890
it looks for me that fflush doesn`t work and all flushing is done during
file closing.
tested it under linux also - both variants are done ok there:
File size: 2890, written: 2890
File size: 2890, written: 2890
$str = '';
for($i = 0;$i < 1000;$i++) {
$str .= $i;
}
$fp = fopen('test.txt', 'wb');
$written = fwrite($fp, $str);
fflush($fp);
clearstatcache();
$size = filesize('test.txt');
echo 'File size: '.$size.', written: '.$written.'<br>';
fclose($fp);
clearstatcache();
$size = filesize('test.txt');
echo 'File size: '.$size.', written: '.$written.'<br>';
--
Edit bug report at http://bugs.php.net/?id=21120&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=21120&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=21120&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=21120&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=21120&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=21120&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=21120&r=support
Expected behavior: http://bugs.php.net/fix.php?id=21120&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=21120&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=21120&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=21120&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=21120&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=21120&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=21120&r=isapi