Jump to content

[SOLVED] filesize seems to "cache" the size of the file?


Recommended Posts

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()!

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.
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.