[Libreoffice] locking semantics ...
Mat M
matm at gmx.fr
Tue Nov 15 13:08:00 PST 2011
Le Mon, 14 Nov 2011 15:39:12 +0100, Michael Meeks <michael.meeks at suse.com>
a écrit:
>
> On Mon, 2011-11-14 at 15:23 +0200, Tor Lillqvist wrote:
>> In both cases, just knowing *who* is holding the document open would be
>> enough.
>
> 'Who' is of course something that we can get incredibly quickly from
> the operating-system, and is already in the file.
>
> Of course, this doesn't deal with the hacker use-case of having dozens
> of LibO open on lots of different systems, and forgetting where you left
> them all but ... ;-) [ hopefully that is a minority use-case ].
>
> We already have the user name + account in the .~lock file I guess; but
> we could prolly do quite a lot better here:
>
> * detecting whether the file is on a network file-system;
> if not - warning about other users using it is pretty
> lame ;-)
> + the downer being that reliably detecting file-system
> type is quite 'fun' - but we do dozens of
> lstat walks down the file-system already anyway so ...
>
Bad idea: Citrix and remote desktops to server allow you to open a local
file multiple times.
Use case: We maintain a spreadsheet with a history of jobs that ran on a
server. The spreadsheet is stored on the server since this one is backuped
;-) and the jobs ran locally too. Using remote desktop, we can be up to 3
(without cost overhead) to look in the file, and maybe edit it.
Other use case: in a small company, someone share a document from his
machine for other to review.
So please keep the lock file for local filesystems.
TY
Mathias M
> * storing the <pid> of the relevant process in the .lock
> file, such that if the system-names match we can verify if
> indeed the .lock file is just stale
>
> * removing .lock files when we select to open a copy, so they
> don't sit around indefinately causing grief when created.
>
> * silently deleting lock files if thy are > a week old (and
> file remains un-touched for that time)
> + where 'week' is customiseable by the paranoid
>
> Or is that highly controversial ? :-) if not, I'll create an 'easy'
> hack or two I guess.
>
> ATB,
>
> Michael.
More information about the LibreOffice
mailing list