Ask Your Question
0

How do I prevent these lock files from being created/deleted?

asked 2017-10-22 18:18:12 +0200

RonUSMC gravatar image

I've searched the web for the past 30 minutes and I'm not seeing any solution. The problem is that just by viewing a document it creates another identical file in a folder with new metadata. That file then resets the date of the folder its in, and therefore the entire archive set, and it seems that they are spreading like a virus inside my NAS system now. I didn't know that just viewing a file created these daughter files and then they are showing up everywhere. My backup program copies files directly and then compresses, so now I have duplicate size files showing up in compressed archives. Some of these files are rather large, so I immediately noticed that the sizes of items were increasing exponentially with time. I've only been using LibreOffice for 3 weeks and its taking me about an hour or two each week to go back and clear out all of these files. If its impossible to remove the functionality, can you at least move the functionality to the Temporary Files Folder as indicated in preferences?

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
1

answered 2017-10-22 18:37:41 +0200

  1. Just viewing document (i.e., opening it with --view command-line switch) does not create those lock files. If you use this mode frequently, you may want to create a shortcut for that, e.g., on desktop, or in file manager context menu (depends on OS/WM you use). Default mode for opening files for editing software (which LibreOffice is) is, naturally, edit, with relevant actions, such as creating lock files.
  2. Those files (when created) are placed to the same directory as edited file for purpose, and moving them to any other place makes absolutely no sense and would ruin that purpose. The purpose is to signal another LibreOffice instance that might want to open that file, that it is already open for editing (not all OS/FS combinations allow doing that reliably using built-in mechanisms), and also which user on which system did that. The other LibreOffice instance is usually run on a different system, and they access files remotely, which means that temp directory of one of them wouldn't be accessible for another. So - no, those files wouldn't be moved anywhere.
  3. However, you can disable that, by using Options-LibreOffice-Advanced-Open Expert Configuration, searching for UseLocking and setting it to false.
edit flag offensive delete link more
0

answered 2017-10-23 13:40:56 +0200

peterwt gravatar image

updated 2017-10-23 18:35:28 +0200

Your question is confusing as you mention lock files in the title but then refer to duplicate daughter files in the text of your question.

First lock files. When you open a file for editing, which is what happens unless you open a file for Viewing, as @Mike Kaganski mentioned in his reply, lock files are created. One is created in the folder that the opened file is in and in the format .~lock.filename.odt# and one in the user profile .lock. As @Mike Kaganski stated these files are to prevent another instance of LO opening and editing the same file. This would create an anomaly as the final state of the file would be the last instance of LO to save the file and any edits by any other instances would be overwritten. The folder date will be changed as the lock file has been created in that folder. The lock files are automatically deleted when the file is closed.

The creation of daughter files may be the file backup feature in LO. This feature creates a backup copy of every LO file in the folder backup in the user profile and is in the form filename.bak. When a file is opened a copy of the file is made in the backup folder. If you make changes to the document and later decide you would like to get back to the file before you made the changes you have the backup file to revert to. Also if the original file becomes corrupt again you have the backup copy. There will only be one backup copy for each file. The setting for this backup feature is in Tools > Options > Load/Save > General. The tick box for "Always create a backup copy" controls this feature - I think the default is on.

EDITED You can also set the locations used to store various things in Tools > Options > Paths except the lock files which will always be in the same folder as the file opened.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2017-10-22 18:18:12 +0200

Seen: 3,245 times

Last updated: Oct 23 '17