[PLUG] file locking
amarendra.godbole at gmail.com
Tue Jul 21 04:26:21 PDT 2009
On Mon, Jul 20, 2009 at 10:34 AM, Aditya Godbole<aag.lists at gmail.com> wrote:
> On Fri, Jul 17, 2009 at 8:48 AM, Vishal Rao<vishalrao at gmail.com> wrote:
>>> I am looking at a user level approach, not a programmer level approach.
>> For a user level (requires cooperation) approach, assume you have the same
>> app sharing files in the same folder, then this app co-operates with other
>> instances by always calling for exclusive lock, then NOT working on the file
>> until it can gain the lock.
> I did not expect to be misunderstood on such a grand scale; let me be
> more specific.
> If a file (inode) has already been opened, all other calls to 'open'
> the file should fail. As simple as that. Is there a way to do this
> using either the native filesystem, or using samba?
User's don't deal with inodes directly ;-). Anyways, Linux does not
have mandatory locking, because of the weaker permission model. All
locks are advisory -- meaning other processes are free to ignore
Things greatly vary across SMB or NFS or
some-remote-mounted-filesystems, and you will have to refer to the
specific man page sections to get an idea.
P.S.: I am still clueless as to what you intend to do.
More information about the plug-mail