Ask Your Question
0

File locked in LibreOffice (no ".~lock" file to delete)

asked 2014-04-27 20:36:23 +0200

Bleb Nevus gravatar image

updated 2015-08-24 21:17:50 +0200

Alex Kemp gravatar image

Virtually every time I work on and then close a LibreOffice file on one of my computers, I find it's been locked and can't be edited when I try to open it in my other computer. (They're shared via a program called SugarSync.) The suggested response on this forum is to find and delete a ".~lock" file in the first computer's directory. Even if it worked, this would be irritating to have to do every time one closes a file. But often it doesn't work because there doesn't seem to be any such file (and, yes, I've enabled "search hidden files"). My computers are running Windows 7 and 8, respectively, by the way, and I'm using the most recent release of Libre on both systems.

The only potentially relevant reply I can find in previous threads about this very serious issue (which, it appears, has persisted for years) says <to disable="" file="" locking,="" edit="" the="" soffice="" script="" and="" change="" the="" line="" "export="" sal_enable_file_locking"="" to="" "#="" export="" sal_enable_file_locking"="">.

Unfortunately, I have no idea where to find this file, let alone how to edit it. Any help would be greatly appreciated.

edit retag flag offensive close merge delete

Comments

Has anyone edited the "soffice script"? This info is in the README file that comes with the .dmg file for installation. I need to do this. I'm on Mac and single user is not supported in OpenOffice. I will not tolerate file locking. To disable file locking, edit the soffice script and change the line "export SAL_ENABLE_FILE_LOCKING" to "# export SAL_ENABLE_FILE_LOCKING". If you disable file locking, the write access of a document is not restricted to the user who first opens the documen

Wholeo gravatar imageWholeo ( 2016-05-01 19:30:03 +0200 )edit

I used this solution for years, it does not work any longer in LO6.

I asked the same question and have had no answers

ealthuis gravatar imageealthuis ( 2018-02-02 15:39:58 +0200 )edit

8 Answers

Sort by » oldest newest most voted
1

answered 2014-06-04 21:21:23 +0200

tplancon gravatar image

Some thoughts on this: Using LibreOffice 4.2.4 on Win 7 Pro on a Windows lan, I see that a lock file is created in the documents file folder called ".~lock.FILENAME.FILEext#" without the quotes. If Win 7 is set to "Don't show hidden files, folders or drives", you won't see it. You must check "Show hidden files, folders or drives". However, even with the hidden file shown, trying to do a search in the directory from Windows explorer, a strange thing happens: type in the search bar ".~" and the file appears, continue to type ".~lock" and the file disappears! Don't know why! Also, using a file sharing service like SugarSync or Dropbox brings its own problems about file locking that has nothing to do with LibreOffice. There are many discussions on the web that discuss this very problem and many of them complain about MS Office. See https://forums.dropbox.com/topic.php?... or http://longforsuccess.com/2011/04/03/...

edit flag offensive delete link more

Comments

Hi, have you tried this solution, seeing whether the lock files are hidden?

nickmdowson gravatar imagenickmdowson ( 2016-03-23 13:50:15 +0200 )edit
0

answered 2015-07-04 01:07:29 +0200

walter.vassallo.9 gravatar image

I have been having the same problem with OOoLilypond and MuseScore extensions. These extensions take the source file and generate an image file which is then imported into Libreoffice. Since v. 4 of Libreoffice it keeps the output file locked and therefore the extensions cannot overwrite it. Overwriting the file is important to update any changes made to the score.

Linke posts: http://ask.libreoffice.org/en/questio... http://ask.libreoffice.org/en/questio...

edit flag offensive delete link more
0

answered 2015-07-04 23:56:34 +0200

peterwt gravatar image

I have not used file sharing sites but have seen a lot of comments on the web regarding problems encountered by users of file sharing sites such as Dropbox with files of LO and MS Office. I think SugarSync may be the cause of your problem.

You could try a test by disabling the syncing of SugarSync on one of your computers (or disconnect from the net). Open a LO document and whilst it is open check that the lock file is there (in the same directory as the file). It does also create another lock file in your profile named .lock. Check that both these files are removed when you exit LO.

The fact that the problem does not always occur may be due to how long you have the file open. If SugarSync has not synced before you close it the lock file will not have been uploaded but if it has synced then it will be uploaded and then downloaded to your other computer.

edit flag offensive delete link more
0

answered 2014-04-28 07:42:23 +0200

frofa gravatar image

updated 2014-05-25 11:02:54 +0200

Is this BUG REPORT (for problems with 'locked' Base files) relevant? Referring to this Bug Report, I don't know what 'an open fd' really means, but maybe that refers to the 'lock' file - on my setup (Mac OS) the file is named databasename.lck - maybe try searching for that file pattern?

Update (25 May 2014): As you probably already know, the 'file locking' mechanism is meant to stop 2 users trying to simultaneously access (and save changes) to the same file to prevent file corruption, so trying work-around this protection is probably not a good idea (if in fact it's possible). However, it seems that occasionally the .~lock file does not get auto-deleted when the user closes the file (probably due to a long-existing bug), and this leads to the problem you are experiencing. In most circumstances the lock file is located in the same directory as the original file, but is a 'hidden' file becuase the filename begins with a dot (.) - and such files will not show up in a search. So you'll probably need to explore how to show hidden files on your Windows OS first before you'll be able to see (and delete) the.~lock file.

edit flag offensive delete link more
0

answered 2014-05-15 17:19:45 +0200

Bleb Nevus gravatar image

Not sure I understand this response, so I wanted to ask whether anyone else might reply. I installed the recent update to LibreOffice and was disappointed to find that this very serious bug apparently hasn't been addressed. Files are still being locked left and right - with no visible "~.lock" file to delete. Has anyone else found a solution?

edit flag offensive delete link more
0

answered 2016-12-10 23:15:26 +0200

pbfoobar gravatar image

I just had the same problem, and ended here. The way I solved it might help someone else.

I could clearly see that the lock file had been deleted. LO still gave me a lock message, saying the file was open by user "unknown."

If Windows does not know that you want say .doc files opened by LibreOffice, the default is something like wordpad, depending on which OS version you are running. Even though I closed that program, it kept running windowless with its own lock, enforced through the OS.

So, check for any programs which might have the file in question, or the lock file open. You can do this with either the free Sysinternals Process Explorer (supported by MS), or by the free Process Hacker. They search all your processes for a handle with the specified string.

edit flag offensive delete link more
0

answered 2014-06-04 19:25:39 +0200

I had the same problem with xls files, so I opened the xls and save in xlsx format. It is working here.

edit flag offensive delete link more
0

answered 2015-07-04 05:20:09 +0200

Alex Kemp gravatar image

updated 2015-07-04 05:23:19 +0200

Locking under Windows can come from at least 2 sources:-

  1. LO/OO locking via the hidden-file
  2. Windows system-locking (for many & varied reasons)

If you are certain that the LO/OO hidden file does not exist, neither in the document directory nor within your user profile, then your document cannot be locked for that reason. In addition, the error message is very specific, mentioning the user that was editing the file + date/time (that information is stored within the hidden file & is repeated verbatim in the error message). Thus, once the hidden file is removed then the error message cannot be displayed. I've suffered this myself under Windows and, once the hidden file was removed (and, in my case, the entire OS replaced) the file became editable again.

If you do not have this kind of file-locking then it is not due to LO/OO; it is due to something else happening within Windows. The possible range of reasons is huge, as Windows is hugely busy, and constantly 'tasting' files for all sorts of reasons, based both at the system level & also at the user-application level; the files get locked by Windows whilst being 'tasted'. Some obvious candidates off the top of my head:-

  1. Windows Search (indexing service to facilitate explorer search)
  2. Anti-Virus
  3. Any one of another 100 services & applications
edit flag offensive delete link more
Login/Signup to Answer

Question Tools

2 followers

Stats

Asked: 2014-04-27 20:36:23 +0200

Seen: 7,409 times

Last updated: Dec 10 '16