Matt Friedman <[EMAIL PROTECTED]> wrote:
> In regards to the <snip> above, under what circumstances might you have
> to create a separate lock file? Is this an OS issue? Is it an issue when
> concurrency is high? The manual says "you may have to"; I am looking for
> some clarification as to when exactly you "may have to" follow the
> <snip> advice.

when you do an fopen("file","w"), it truncates the file -- before you
can call flock(). so if one process locks the file, and starts writing
data, a second one could just come along and blow away all or part of
the data even though the first still has it locked. by the time the
second process calls flock() and notices that the first has it locked,
it has already truncated the file.


PHP General Mailing List (
To unsubscribe, visit:

Reply via email to