file locking misconception

John Gilmore gnu at l5.uucp
Fri Dec 27 17:41:22 AEST 1985


In article <7022 at ki4pv.UUCP>, tanner at ki4pv.UUCP (Tanner Andrews) writes:
>                                                    there's no real
> excuse for a read-only prog to need to lock a file if the write-file
> prog successfully locks the damned thing anyway.

Uh, suppose the readers want a consistent copy of the file?  flock(),
at least in 4.2BSD, is an *advisory* lock -- it doesn't stop anybody
from doing anything with the file except flock() it again.  Readers can
use shared locks and writers use exclusive locks, for many applications.



More information about the Comp.bugs.4bsd.ucb-fixes mailing list