#21120 [Opn->Fbk]: fflush doesn`t work
| From: | iliaa@php.net | Date: | Sat, 21 Dec 2002 18:11:00 +0000 |
| Subject: | #21120 [Opn->Fbk]: fflush doesn`t work | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-28165@lists.php.net to get a copy of this message | ||
ID: 21120
Updated by: iliaa@php.net
Reported By: rashid@php.net
-Status: Open
+Status: Feedback
Bug Type: Filesystem function related
Operating System: win2k pro
PHP Version: 4.2.3
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php4-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php4-win32-latest.zip
Previous Comments:
------------------------------------------------------------------------
[2002-12-20 16:01:39] rashid@php.net
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 this bug report at http://bugs.php.net/?id=21120&edit=1