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

``Locking'' Files



    Date: Wed 7 Oct 87 10:53:20-EDT
    From: INGRIA@g.bbn.com

	    I would like to be able to lock a data file so that when one
    user is editing it, no one else can edit it (although they might be
    able to visit it in read-only mode).  Are there built-in facilities
    that allow one to do this?  (There doesn't seem to be any documented
    way to do this and my searches for likely sounding candidates haven't
    turned up anything).  Has anybody out there already written such a
    mechanism?

We have a mechanism we call "MUser" (for Multi-User).  Files that have
the "Muser: Yes" attribute invoke this facility.  The first time you try
to modify a buffer, a request for permission is sent to a central
server.  If the file is not already being edited on another machine, it
returns permission and records that the file is being edited by that
machine.  If it thinks another machine is editing the file, it returns
the name of that machine, and a query to that machine is sent to  find
out if it is still editing the file (saving or unmodifying a buffer
notifies the MUser server, but killing a buffer or rebooting a machine
doesn't).  If the other machine is still editing it, or if the central
server or other machine doesn't respond, the user is thrown into the
debugger (there is a proceed option that lets you modify it anyway).

I plan on submitting this to the SLUG library in the near future, so
please don't flood me with requests to mail it.  I want to write some
documentation, and perhaps move it to its own package (it is currently
in the ZWEI package), before submitting it.

For those who are interested in using it the way it is, I'll make it
available for anonymous FTP soon.  I'll send mail when I get this set
up.

                                                barmar