D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] Open Office - files locked for editing: Solved but for info.

 

On Fri, Sep 23, 2016 at 04:44:45PM +0100, Julian Hall wrote:
> Why would it open in MS Word in the Windows 7 VM and not in OOO? Why
> locally and not from the NAS? The latter pointed me at the NAS as
> the culprit.

I don't know much about locking files in OOO, but it's often done by
the software (rather than by the document) and based on the file
location.

In fact, you could observe the same behaviour in vim.

Open a terminal window and open a test file for editing using

  vim test

This creates a hidden file .test.swp which locks the file for editing
(and stores any unsaved changes). If, in a different terminal window,
you were to run

  vim test

it tells you the file is locked. (You can stubbornly choose to edit it
anyway.) However, opening it with any other text editor (emacs, gedit
etc.) doesn't show any problem.

Nor does moving or copying the file (but not the .swp file) to
another directory.  If, after saving your test file, but without
closing vim, you run

  cp test /tmp
  vim /tmp/test

you can edit it without any problem.

It is possible for the file format itself to allow for certain flags
within the document to be set that tell the programs opening it not to
allow editing. I believe PDF lets you do that. But programs can (and
often do) ignore that. And it would be a right pain for files, like
office documents, that are explicitly used for editing.

So other than the mystery of the lock being created in the first place,
what you saw makes sense.

Martijn.

Attachment: signature.asc
Description: Digital signature

-- 
The Mailing List for the Devon & Cornwall LUG
https://mailman.dclug.org.uk/listinfo/list
FAQ: http://www.dcglug.org.uk/listfaq