ID:               21120
 Comment by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
 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] [EMAIL PROTECTED]

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] [EMAIL PROTECTED]

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

Reply via email to