B0b Posted December 30, 2009 Share Posted December 30, 2009 Hi guys, Firstly, happy new year in advance. I'd like your opinions on this matter: in which circumstance could filesize() return 0 (not false), no error, when the file does exist (file_exists()) and isn't empty (just got fwritten) and directory is properly CHMODed? Strange isn't? If I open it with 'a' and there's allready content in it, it'll return the initial size before being written in by the script, even though the function is called after fwritten. What could cause this sort of delay? Quote Link to comment https://forums.phpfreaks.com/topic/186744-strange-issue-with-phps-filesize/ Share on other sites More sharing options...
salathe Posted December 30, 2009 Share Posted December 30, 2009 Are you trying to get the file size before it's opened or whilst it's open, before it's written or after it's written, before it's closed or after it's closed? Or none of the above? Quote Link to comment https://forums.phpfreaks.com/topic/186744-strange-issue-with-phps-filesize/#findComment-986163 Share on other sites More sharing options...
B0b Posted December 30, 2009 Author Share Posted December 30, 2009 After it was written (obviously), before being opened (obviously) and before/after being closed (tried both). Haaah, that's bad. Quote Link to comment https://forums.phpfreaks.com/topic/186744-strange-issue-with-phps-filesize/#findComment-986171 Share on other sites More sharing options...
Daniel0 Posted December 30, 2009 Share Posted December 30, 2009 Try clearing the stat cache. Quote Link to comment https://forums.phpfreaks.com/topic/186744-strange-issue-with-phps-filesize/#findComment-986174 Share on other sites More sharing options...
B0b Posted December 31, 2009 Author Share Posted December 31, 2009 I knew I had to eventually clear that cache, but didn't thought it was so urgent Quote Link to comment https://forums.phpfreaks.com/topic/186744-strange-issue-with-phps-filesize/#findComment-986196 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.