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 ...

        * 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.

-- 
michael.me...@suse.com  <><, Pseudo Engineer, itinerant idiot

_______________________________________________
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice

Reply via email to