Re: Re: Mandatory File Locking in PHP?
| From: | Ananth Kesari | Date: | Thu, 30 Jan 2003 09:28:34 +0000 |
| Subject: | Re: Re: Mandatory File Locking in PHP? | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-93797@lists.php.net to get a copy of this message | ||
So, as of now, do we restrict PHP script to use only advisory file locking?
Thanks,
Ananth.
>>> George Schlossnagle <george@omniti.com> 01/30/03 06:54AM >>>
On Wednesday, January 29, 2003, at 07:11 PM, Marcus Börger wrote:
>
>> The real question is why you need mandatory locks and not advisory
>> locks. If everyone is playing on the same team, advisory locks
>> should provide all the semantics you need (and are very portable).
>> Mandatory locks (on linux at least) require not only special mount
>> options, but special perms to the file (g-x, g+s, I believe). That
>> seems like a lot to require inside an extension.
>
> The dba solution so far is based on flock() and where not appropriate
> use fctnl().
> I tried to have the lock stuff working on as many systems as possible.
Right. Both of these are pretty portable, one being present on all
BSD-style systems and the other on POSIX systems. They are also
advisory locks. Mandatory locks actually prevent read and write calls
from _anyone_ else succeeding on that file. On linux, mandatory locks
are set with fcntl, but it's not part of the standard POSIX standard.
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php