Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 16 Sep 2001 07:25:29 GMT
From:      groggy@iname.com
To:        "freebsd-questions" <questions@freebsd.org>
Subject:   file locking #2
Message-ID:  <200109160725.HAA34229@groggy.anc.acsalaska.net>

next in thread | raw e-mail | index | archive | help
4.3 FBSD.

> i never got an answer to this question i posted a few weeks ago,
> nd cuz it's important to some scripting i am doing,
> i thought i'd try again.
> 
> FBSD's file locking scheme changed somewhat from version 2 to version 3. in
> v2 a user could open the same file on multiple terminals with RW
> permissions.  in v3, this could'nt be done, only the 1st instance of opening
> a file would have RW permission; instances thereafter would have only R
> permission.
> 
> however with v3, server processes always have RW permission, even if the
> file is currently open with in a user process with RW permission.
> 
> it makes some sense, but i am not sure that i understand this scheme
> completely, since file locking now has somewhat of a split personality.
> 
> does it come down to this: user/interactive login shell processes only have
> RW on the first instance of a file being opened, while all other processes
> have RW permission always?
> 
> also - how do one know when to use file locks in scripts - what quantity of
> data is safe to write to a file with other processes possibly simultaneously
> writing to the same file?
> 
> thank you.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200109160725.HAA34229>