| 
        php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             
             [1999-02-21 15:51 UTC] jim
  | 
    |||||||||||||||||||||||||||
            
                 
                Copyright © 2001-2025 The PHP GroupAll rights reserved.  | 
        Last updated: Tue Nov 04 12:00:01 2025 UTC | 
It seems, and maybe this is more relevant in notes, and is not a bug, that the filesize command caches it's last result for a filename, and when called again with the same filename, doesn't go out and requery the file size. I have a small script which downloads a remote picture, runs getImageSize on it, then filesize. When I download the file, I use the name tmp.jpg, and I do so sequentially. thumb1 and thumb2 are different files with different sizes. Filesize returns the same filesize for both because they are written out using the same filename. // Thumb1 if ( $thumb1 ) { $fileIn = fopen($thumb1, "r"); if ( $fileIn ) { $data = fread($fileIn, 500000); fclose($fileIn); $fileOutName = "/tmp/tmp.jpg"; $fileOut = fopen($fileOutName, "w"); fwrite($fileOut, $data); fclose($fileOut); $size = GetImageSize($fileOutName); $thumb1w= $size[0]; $thumb1h= $size[1]; $thumb1size = $size[3]; $thumb1s = FileSize($fileOutName); } } // Thumb 2 if ( $thumb2 ) { $fileIn = fopen($thumb2, "r"); if ( $fileIn ) { $data = fread($fileIn, 500000); fclose($fileIn); $fileOutName = "/tmp/tmp.jpg"; $fileOut = fopen($fileOutName, "w"); fwrite($fileOut, $data); fclose($fileOut); $size = GetImageSize($fileOutName); $thumb2w= $size[0]; $thumb2h= $size[1]; $thumb2size = $size[3]; $thumb2s = FileSize($fileOutName); } }