Page 1 of 2

[Solved] Disable lock file creation

Posted: Sun Jun 16, 2019 4:52 pm
by amsharma
Hi,

I am using OpenOffice 4.1.3 on Windows 10 (64 bit). Can I disable lock file creation? I know they are needed for various good reasons but I want to disable them. I have checked everywhere on this forum and searched internet but found NO CLEAR replies. Kindly just provide a straight answer:
- Is it possible to disable lock file creation.
- If yes, what do I have to set.

If the above is NOT possible then can I change the directory where the lock files get created, say "Temp" folder etc. I don't want them to be created in the directory of the original document.

Thanks
Amal

Re: How to disable lock file creation

Posted: Sun Jun 16, 2019 5:16 pm
by RoryOF
Why do you not want them? Normally they should not affect you at all.

Re: How to disable lock file creation

Posted: Sun Jun 16, 2019 5:36 pm
by amsharma
So we come back to the "Why". Can we avoid getting into that for the time being and focus on the solution.

Ok, I will give you one of the reasons. I don't want any extra Writes happening on my SSD. Hope we will not get into the "Why" of that.

I saw this on one of the posts. Does this work? Where can this be set?
org.openoffice.Office.Common/Misc/UseLocking = false

Re: How to disable lock file creation

Posted: Sun Jun 16, 2019 5:58 pm
by Villeroy
If you can edit large XML files:
Make a backup copy of %APPDATA%\OpenOffice\4\user\registrymodifications.xcu
Find the following similar node:

Code: Select all

<item oor:path="/org.openoffice.Office.Common/Misc"><prop oor:name="FirstRun" oor:op="fuse"><value>false</value></prop></item>
and add this node nearby:

Code: Select all

<item oor:path="/org.openoffice.Office.Common/Misc"><prop oor:name="UseLocking" oor:op="fuse"><value>false</value></prop></item>

Re: How to disable lock file creation

Posted: Sun Jun 16, 2019 6:08 pm
by Zizi64
Ok, I will give you one of the reasons. I don't want any extra Writes happening on my SSD. Hope we will not get into the "Why" of that.
I am using an SSD to install and launching the softwares, and a HDD for storing the documents.

Re: How to disable lock file creation

Posted: Sun Jun 16, 2019 6:31 pm
by RoryOF
Villeroy has given an answer; beware! you may damage your OO installation if not careful. It may be better to keep your operating system on the SSD and your data files on an ordinary hard disk drive, as Zizi64 suggests, but it is your choice and your computer
.

Re: How to disable lock file creation

Posted: Sun Jun 16, 2019 6:40 pm
by amsharma
Villeroy wrote:If you can edit large XML files:
Make a backup copy of %APPDATA%\OpenOffice\4\user\registrymodifications.xcu
Find the following similar node:

Code: Select all

<item oor:path="/org.openoffice.Office.Common/Misc"><prop oor:name="FirstRun" oor:op="fuse"><value>false</value></prop></item>
and add this node nearby:

Code: Select all

<item oor:path="/org.openoffice.Office.Common/Misc"><prop oor:name="UseLocking" oor:op="fuse"><value>false</value></prop></item>
Ok, I tried this. After editing when I start OO, it creates a lockfile. I exited OO and checked the line I added to the xcu file. It doesn't exist. Looks like OO deletes the line I added from the xcu file. I tried this twice to reconfirm. Do I need to do something more.

Re: How to disable lock file creation

Posted: Sun Jun 16, 2019 8:32 pm
by John_Ha
amsharma wrote:Is it possible to disable lock file creation.
No.

Why? Because it's a daft idea to disable it as it is likely to lead to data loss even if you are the only user of the PC. It's only about 100 bytes whereas, when you open a saved file, a complete copy of the file is written to the temporary directory. 100 bytes is completely trivial in comparison.
amsharma wrote:Ok, I will give you one of the reasons. I don't want any extra Writes happening on my SSD. Hope we will not get into the "Why" of that.
That is an absolutely ridiculous reason.

Why? Because writing a lock file is an absolutely trivial operation and has no discernable effect on an SSD's performance or on its life. Can I suggest you do a deeper study of SSD performance so you understand precisely what I said and why I said it. Look for the value of IOPS - writing a lock file is 1 IO and today's SATA SSDs can typically write 100,000 IO per second, some significantly more. You would be saving 1 in 100,000 or 0.001% over one second.

It's like saving 1 cent on a bill of 1,000 euros or dollars. Or trying to cut 1m off a 100km walk to save shoe leather.

Don't waste your (or our) time.

Re: How to disable lock file creation

Posted: Sun Jun 16, 2019 8:49 pm
by Bill
Disabling lock file creation to save writing 76 bytes isn't worth the trouble. After all, saving an edited file would write many kilobytes and operating system updates can write many megabytes.

Re: How to disable lock file creation

Posted: Sun Jun 16, 2019 8:59 pm
by Lupp
I also don't understand what reasons might justify to forego the important functionality based on lock files.
In addition I feel sure there isn't a way to do it for Writer only. Changes will aflict files of all the component types.

However, LibO for a long time now offers the fetaure >Tools>Options>LibreOffice>Advanced>Open Expert Configuration, there a Search line where you may enter "lock", and ways to edit any of the properties you find. Among these is the one Villeroy already mentioned, and if you change it, the changes will persist closing down and reopening LibO.

To everybodey not exactly knowing what he is doing and for what absoluteley urgent reasons: Don't do it!

Re: How to disable lock file creation

Posted: Sun Jun 16, 2019 9:02 pm
by RoryOF
I agree with Bill and John_Ha. I have checked a fresh registrymodifications.xcu and can not find any references to "lock".

Re: How to disable lock file creation

Posted: Sun Jun 16, 2019 9:05 pm
by John_Ha
When I start AOO, it creates an empty file Untitled 1. AOO creates a folder in \temp and writes two temporary files to the folder. One is 9kB, the other is 0Kb.

AOO also appears to rewrite registrymodifications.xcu (it gets a new date stamp) which, in my case, is nearly 700kBytes.

A typical lock file is 100 bytes.

Another analogy: I always wash my face before weighing myself so as not to include the weight of the dust on my face.

Re: How to disable lock file creation

Posted: Sun Jun 16, 2019 9:09 pm
by RoryOF
My thought was that the lock file generation is not controlled by registrymodifications,xcu as there is no apparently relevant line in it.

Re: How to disable lock file creation

Posted: Sun Jun 16, 2019 9:38 pm
by Lupp
@RoryOF: The registry node Villeroy described was most likely taken from his LibO registrymodifications.xcu. LibO definitely introduced the Boolean property under discussion. AOO didn't, and therefore may remove an inserted xml section containing it when tidying up.

Re: How to disable lock file creation

Posted: Sun Jun 16, 2019 11:10 pm
by John_Ha
On my 4GB PC (with an SSD) hiberfil.sys is 3.1 GB and pagefile.sys is 4.2 GB.

Booting the PC once therefore writes 7.3 GB which is equivalent to writing 73,000,000 lock files.

Re: How to disable lock file creation

Posted: Mon Jun 17, 2019 2:37 am
by amsharma
My thought was that the lock file generation is not controlled by registrymodifications,xcu as there is no apparently relevant line in it.
Lupp wrote:@RoryOF: The registry node Villeroy described was most likely taken from his LibO registrymodifications.xcu. LibO definitely introduced the Boolean property under discussion. AOO didn't, and therefore may remove an inserted xml section containing it when tidying up.
So we aren't sure of the functionality in OO. Do we have any OO Developers or Engineering team etc on this forum to confirm what @Villeroy wrote.
On my 4GB PC (with an SSD) hiberfil.sys is 3.1 GB and pagefile.sys is 4.2 GB.

Booting the PC once therefore writes 7.3 GB which is equivalent to writing 73,000,000 lock files.
@John_Ha FYI, I don't use a hiberfil.sys and my paging & swap files are on RAM Disk.

Re: How to disable lock file creation

Posted: Mon Jun 17, 2019 3:23 am
by robleyd
Do we have any OO Developers or Engineering team etc on this forum to confirm what @Villeroy wrote.
None that have made their presence known. You might consider joining the Development Mailing List and asking your question there

Re: How to disable lock file creation

Posted: Mon Jun 17, 2019 9:36 am
by RoryOF
The only instances of the sequence

Code: Select all

~.lock 
the prefix for the lock files, that a global search finds in the OpenOffice source code are in FileHelper.java, documentfilelock.cxx and in two files with long names but identical sizes as the above files, which I think to be copies of the above made as part of the svn file identification process.

This is not to say that the sequence might not be assembled elsewhere from individual tokens.

If the presence of the lock file is of concern, these named files could be investigated and any modifications thought necessary made, then the adjusted source code recompiled to generate a custom OpenOffice.

Re: How to disable lock file creation

Posted: Mon Jun 17, 2019 12:41 pm
by John_Ha
amsharma wrote:Ok, I will give you one of the reasons. I don't want any extra Writes happening on my SSD. Hope we will not get into the "Why" of that.
A typical 250 GB SSD will write between 60 and 150 terabytes - say it is 100 TB. In actual tests far higher values are achieved - a Samsung SSD 850 PRO disk achieved a figure of 9.1 Petabyte, 60x more than the rating.

If you edit 10,000 .odt files over that period lock files will use 1 MB, or one millionth of one percent, of the 100TB write capacity. It is completely negligible and other factors are far more important.

Re: How to disable lock file creation

Posted: Mon Jun 17, 2019 3:48 pm
by Bill
amsharma wrote:So we aren't sure of the functionality in OO. Do we have any OO Developers or Engineering team etc on this forum to confirm what @Villeroy wrote.
I'm not a developer or engineer, but I do know how to use Google. Use Google to search for the terms "uselocking" and "openoffice". The only hit actually containg those two terms is this forum thread. There are many other hits containing the terms "uselocking" and "libreoffice", including a bug report for LibreOffice. There is no bug report for OpenOffice using the term "uselocking". If you feel that this is an important feature, then you should submit a bug report for OpenOffice.

Re: How to disable lock file creation

Posted: Mon Jun 17, 2019 9:53 pm
by AOOisdead
Just a friendly reminder that AOO is a zombie project and it's unlikely to have any major changes pushed to AOO (If you look at their dev mailing list or their bugzilla, they aren't able to push major changes because of bitrot and lack of volunteers). I would pursue your uselock issue with LibreOffice developers.

Re: How to disable lock file creation

Posted: Tue Jun 18, 2019 12:52 am
by Bill
While there are reasons to use LO, switching to LO to save a few bytes by disabling lock file creation isn't one of them. The number of writes to the SSD would increase because LO requires more disk space than AOO and is updated more frequently.

Re: How to disable lock file creation

Posted: Tue Jun 18, 2019 6:33 am
by Zizi64
The number of writes to the SSD would increase because LO requires more disk space than AOO and is updated more frequently.
The LibreOffice will not updated either automatically nor manually (read: accidentally by some clicking) without manual downloading the new installer file, and without launching it. This behavior or the LO is same as in AOO.
And the LO consupts more disk space when you install all of the language tools for all of available languages, and all of the localized Helps. Otherwise there is not significant difference in the sizes.

Re: How to disable lock file creation

Posted: Tue Jun 18, 2019 1:12 pm
by John_Ha
Bill wrote:While there are reasons to use LO, switching to LO to save a few bytes by disabling lock file creation isn't one of them. The number of writes to the SSD would increase because LO requires more disk space than AOO and is updated more frequently.
AOO 4.1.6 installs in 315 MBytes whereas LO 6.0.2.1 installs in 499 MBytes. That difference is 184 MBytes, enough for 1,840,000 lock files.

This is the contents of the lock file for Fred where John H is my AOO registration, Bilbo-Baggins is the Pc name.

Code: Select all

John H,Bilbo-Baggins/John,Bilbo-Baggins,18.06.2019 12:44,file:///C:/Users/John/AppData/Roaming/OpenOffice/4;
So, recommendations to the OP are

1. Make sure you register AOO with just a single character. This will save 5 bytes per lock file compared with me.
2. Name your PC with one character. This will save 12 bytes per lock file compared with me.
3. Set up Tools > Options > OpenOffice > Paths ..., to C:\A. This will save a whopping 37 bytes per lock file compared with me and is obviously the key one!

Doing this will reduce each lock file by 54 bytes - in fact it halves the lock file size. You need to be aware that there is a "Year 9999" problem because the file will write an extra byte for the year 10000 date.

However, you will need to do some tests to confirm this. The SSD probably uses 4KByte block sizes so the question is "Does the "write deleted files to zero" action write just the written bytes? or the entire block?" If the entire block is written to zero then, of course, this won't really save as much as you were hoping because the 4k bytes written when setting the deleted file bits to zero far outweighs the 50 or so bytes you save writing the smaller lock file. Also check whether a "set bit to zero" counts as a write compared with a "set bit to 1".

Re: How to disable lock file creation

Posted: Tue Jun 18, 2019 5:01 pm
by amsharma
AOOisdead wrote:Just a friendly reminder that AOO is a zombie project and it's unlikely to have any major changes pushed to AOO (If you look at their dev mailing list or their bugzilla, they aren't able to push major changes because of bitrot and lack of volunteers). I would pursue your uselock issue with LibreOffice developers.
Is this true? It's disheartening to hear this. I was under the impression OO was going full speed ahead competing with other Office products. I thought there would be some core team, they would have enough funds, probably be getting enough donations, interns / project interns (from colleges etc), volunteers etc to take OO forward. I tell people at all forums to use OO. Lets hope things improve for OO.

Re: How to disable lock file creation

Posted: Tue Jun 18, 2019 5:22 pm
by John_Ha
Unfortunately correct as AOO is effectively dead. LO is under active development.

Re: How to disable lock file creation

Posted: Tue Jun 18, 2019 9:09 pm
by RusselB
If I was a doctor and OO was my patient, I wouldn't call the patient deceased, but (probably) in coma.

Re: How to disable lock file creation

Posted: Tue Jun 18, 2019 9:50 pm
by Lupp
amsharma wrote:I tell people at all forums to use OO.
That's not bad. As time goes by, however, you may also need to tell them they might better shift to LibreOffice one day to avoid a too big gap to step over concerning changes in the look-an-feel. It's mainly the user interface that may one day make it more difficult to move. That doesn't mean LibO is generally better insofar.

To be a competent advisor concerning free and open Office applications, you may want to try out LibO as the main altenative to AOO, too. You can do so using a portable package to avoid the need of an install.

Re: How to disable lock file creation

Posted: Wed Jun 19, 2019 12:40 am
by AOOisdead
There have been attempts at giving AOO a graceful retirement, but they are rebuffed by ego's. Currently there are only 4 or 5 people that occasionally file commits to the project, and mostly to language compatability improvements. There is only one existing active contributor that has any programming knowledge of the AOO code base. This is easy to see on the Dev mailing list archive if you look at the past few years. It's a fascinating case study of volunteer organization decline. However it's outrageous that the Apache Foundation would let a project that millions rely on to seem operational when there are unpatched security issues and ever increasing compatability problems.

Edit: actually there have also been attempts to pare down AOO to allow for rejuvenation of the code (they wanted it to be a skeleton other projects could build on and go different directions in by leveraging the freedom of the Apache license), but even those were rebuffed by some individuals that want the project to stay as is. The problem is, anyone new looks at the code base, sees how old it is (plus all the German language commits that LO took 3 years to fully convert to English), see's that LO has already refactored, and then moves on to a newer project, or to LO.

Re: How to disable lock file creation

Posted: Fri Jun 21, 2019 2:24 pm
by amsharma
AOOisdead wrote:There have been attempts at giving AOO a graceful retirement, but they are rebuffed by ego's. Currently there are only 4 or 5 people that occasionally file commits to the project, and mostly to language compatability improvements. There is only one existing active contributor that has any programming knowledge of the AOO code base. This is easy to see on the Dev mailing list archive if you look at the past few years. It's a fascinating case study of volunteer organization decline. However it's outrageous that the Apache Foundation would let a project that millions rely on to seem operational when there are unpatched security issues and ever increasing compatability problems.

Edit: actually there have also been attempts to pare down AOO to allow for rejuvenation of the code (they wanted it to be a skeleton other projects could build on and go different directions in by leveraging the freedom of the Apache license), but even those were rebuffed by some individuals that want the project to stay as is. The problem is, anyone new looks at the code base, sees how old it is (plus all the German language commits that LO took 3 years to fully convert to English), see's that LO has already refactored, and then moves on to a newer project, or to LO.
Thanks for the in-depth update. Appreciate that very much. Sad to hear all this. Apache Foundation must allocate funds to this project and make it work. Finally it comes down to money. If they can allocate funds then OO doesn't need to depend only on volunteers. I know so many government organizations that use it all over the world (read many articles about it) including here in India. Apache can't let it go into coma.
That's not bad. As time goes by, however, you may also need to tell them they might better shift to LibreOffice one day to avoid a too big gap to step over concerning changes in the look-an-feel. It's mainly the user interface that may one day make it more difficult to move. That doesn't mean LibO is generally better insofar.
I had been telling my friends & NGOs to move to OO but probably must tell them to move to LO.

I discovered another Office Suite which has a free version and its compact https://www.wps.com. Interesting and neat. I tried it. Seems to be good. Has any of you tried it.