Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- can't understand flock()
May 1, 2005, 7:59 pm
rate this thread
I've scoured over manual page for flock on http://in2.php.net/flock but
I can't understand a few things:
1. will flock wait until a different process releases the lock ?
2. please clarify this line:
" If you don't want flock() to block while locking, add LOCK_NB "
what does "block" mean above?
I'd like to use flock() in a manner that when locking attempt fails on
a file (maybe it is alreadly locked by some other process) then the
script wouldn't wait but go on and do something, eg: close the file.