Is SPLFileObject atomic?

Posted by Jakub Lédl on Stack Overflow See other posts from Stack Overflow or by Jakub Lédl
Published on 2010-06-12T21:15:48Z Indexed on 2010/06/12 21:22 UTC
Read the original article Hit count: 329

Filed under:
|

I'm wondering whether methods of PHPs SPLFileObject are atomic (e.g. thread-safe) or not?

If they aren't, I'll implement my own class, which will use flock(), but is this enough? Is the flock function really thread-safe? What if the collision occurs after I fopen() the file, but before I flock() it?

© Stack Overflow or respective owner

Related posts about php

Related posts about atomicity