>From the manual:

<snip>
Note: Because flock() requires a file pointer, you may have to use a
special lock file to protect access to a file that you intend to
truncate by opening it in write mode (with a "w" or "w+" argument to
fopen()).
</snip>

The manual indicates that you "may" need to use "a special lock file" if
you intend to open a file with "w" or "w+". I wrote some code to examine
this. (2 files) Each file locks a file after opening using "w" to do so.
Then, the file is locked using LOCK_EX. Subsequently executed, each file
appears to respect the lock applied by the other file. (Each file waits
for the lock to be released by the other) - So, I don't see this manual
entry applying in this case.

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.

Thanks as always,

Matt Friedman
Web Applications Developer
www.SpryNewMedia.com




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to