Boylett Posted April 15, 2009 Share Posted April 15, 2009 I have this code: http://pastebin.com/m25321102 And basicly, the file $fname keeps growing over the limit (MAX_LOG_SIZE), and it seems to be because filesize returns the same thing it returned the first time. e.g. output could be: Size: 678 (Which is correct) Size: 678 Size: 678 Size: 678 (All these values are incorrect, the file is now bigger then these) Is there something in my code making filesize() appear to cache the size? And if so how do I fix it. Thanks EDIT: nvm, after 30 minutes of googling i found clearstatcache()! Quote Link to comment https://forums.phpfreaks.com/topic/154214-solved-filesize-seems-to-cache-the-size-of-the-file/ Share on other sites More sharing options...
PFMaBiSmAd Posted April 15, 2009 Share Posted April 15, 2009 That's why you read the php manual section for whatever function you are using before you use it and especially after it does not work the way you have used it. Note: The results of this function are cached. See clearstatcache() for more details. Quote Link to comment https://forums.phpfreaks.com/topic/154214-solved-filesize-seems-to-cache-the-size-of-the-file/#findComment-810726 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.