Jump to content

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


Boylett

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.