Camen Design Forum

PHP and filesystem efficiency?

JJ

Actually - another filesystem question now that I think about it, if anyone is willing: If two users visit the site and end up overwriting the same cache file at the same time, isn't there a possibility the both of them writing to the file at the same time could corrupt the data? Is it wise to use flock() or LOCK_EX in the file_put_contents call? Again, I'm not an expert when it comes to filesystems, so I apologize if this is a stupid question.

Append

(Leave this as-is, it’s a trap!)

Only the original author or a moderator can append to this post.

Pro tip: Use markup to add links, quotes and more.

Your friendly neighbourhood moderators: Kroc, Impressed, Martijn