Re: mcedit file locking



On Tue, 25 Mar 2003, Oswald Buddenhagen wrote:

> On Tue, Mar 25, 2003 at 01:59:12AM -0500, Pavel Roskin wrote:
> > 3) System-wide locks using fcntl() or (if not supported) flock().
> >
> i'd go with that one.
> 
> > Pro: No stale locks.  Works in non-writable directories.  Locking between
> > users.
> > 
> and it's simple (except the #ifdef for fcntl vs. flock). the other
> variants get hairy once you try to get around the stale lock problem.
> 
> > Con: not 100% portable, but should work on most modern systems. 
> > 
> and it's halfways broken over nfs - at least one of the variants. check
> out the man page.
> 
> > Locks affect other software.
> >
> that's a) not exactly a downside, if you ask me and b) usually not true,
> as the locks are only advisory, not mandatory, so "the other"
> application has to use locking itself to notice what we do.

Just for the record - Cygwin currently supports only mandatory file locks.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]