|
Posted by Gordon Burditt on 11/15/07 01:07
>> Flock doesn't fit me. Flock is used to make lock
>> FROM WITHIN php script.
>
>Indeed. So if a PHP script can obtain an exclusive (writer's) lock on
>a file, it means that no other process has that lock, meaning that the
>file is not open for writing at the moment...
flock() is advisory, meaning that it won't stop someone else from
reading or writing, unless that someone else is obtaining locks
before doing the reading or writing. *Mandatory* locking has great
potential for evil (e.g. lock some critical system files, then go
to sleep indefinitely, and anyone trying to log in ends up waiting
for you to let go of the locks).
Navigation:
[Reply to this message]
|