#21120 [Com]: fflush doesn`t work

From: Date: Sat, 21 Dec 2002 19:19:14 +0000
Subject: #21120 [Com]: fflush doesn`t work
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-28167@lists.php.net to get a copy of this message
ID: 21120 Comment by: rashid@ds.pg.gda.pl Reported By: rashid@php.net Status: Feedback Bug Type: Filesystem function related Operating System: win2k pro PHP Version: 4.2.3 New Comment: no changes with latest windows build (PHP Version 4.4.0-dev) Previous Comments: ------------------------------------------------------------------------ [2002-12-21 12:10:59] iliaa@php.net 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 ------------------------------------------------------------------------ [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

« previous php.bugs (#28167) next »