[Solved] Disable lock file creation

Discuss the word processor
amsharma
Posts: 11
Joined: Sun Jul 27, 2014 2:44 pm

[Solved] Disable lock file creation

Post 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
Last edited by Hagar Delest on Thu Jul 04, 2019 8:04 am, edited 1 time in total.
OpenOffice 4.1.3 on Windows 10 (64bit)
User avatar
RoryOF
Moderator
Posts: 34586
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: How to disable lock file creation

Post by RoryOF »

Why do you not want them? Normally they should not affect you at all.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
amsharma
Posts: 11
Joined: Sun Jul 27, 2014 2:44 pm

Re: How to disable lock file creation

Post 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
OpenOffice 4.1.3 on Windows 10 (64bit)
User avatar
Villeroy
Volunteer
Posts: 31269
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: How to disable lock file creation

Post 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>
Last edited by Villeroy on Sun Jun 16, 2019 6:19 pm, edited 1 time in total.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
User avatar
Zizi64
Volunteer
Posts: 11352
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: How to disable lock file creation

Post 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.
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
User avatar
RoryOF
Moderator
Posts: 34586
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: How to disable lock file creation

Post 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
.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
amsharma
Posts: 11
Joined: Sun Jul 27, 2014 2:44 pm

Re: How to disable lock file creation

Post 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.
OpenOffice 4.1.3 on Windows 10 (64bit)
John_Ha
Volunteer
Posts: 9583
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: How to disable lock file creation

Post 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.
Last edited by John_Ha on Sun Jun 16, 2019 8:50 pm, edited 1 time in total.
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
Bill
Volunteer
Posts: 8932
Joined: Sat Nov 24, 2007 6:48 am

Re: How to disable lock file creation

Post 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.
AOO 4.1.14 on Ubuntu MATE 22.04
User avatar
Lupp
Volunteer
Posts: 3542
Joined: Sat May 31, 2014 7:05 pm
Location: München, Germany

Re: How to disable lock file creation

Post 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!
Last edited by Lupp on Sun Jun 16, 2019 9:03 pm, edited 1 time in total.
On Windows 10: LibreOffice 24.2 (new numbering) and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
User avatar
RoryOF
Moderator
Posts: 34586
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: How to disable lock file creation

Post by RoryOF »

I agree with Bill and John_Ha. I have checked a fresh registrymodifications.xcu and can not find any references to "lock".
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
John_Ha
Volunteer
Posts: 9583
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: How to disable lock file creation

Post 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.
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
User avatar
RoryOF
Moderator
Posts: 34586
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: How to disable lock file creation

Post 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.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
User avatar
Lupp
Volunteer
Posts: 3542
Joined: Sat May 31, 2014 7:05 pm
Location: München, Germany

Re: How to disable lock file creation

Post 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.
On Windows 10: LibreOffice 24.2 (new numbering) and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
John_Ha
Volunteer
Posts: 9583
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: How to disable lock file creation

Post 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.
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
amsharma
Posts: 11
Joined: Sun Jul 27, 2014 2:44 pm

Re: How to disable lock file creation

Post 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.
OpenOffice 4.1.3 on Windows 10 (64bit)
User avatar
robleyd
Moderator
Posts: 5055
Joined: Mon Aug 19, 2013 3:47 am
Location: Murbko, Australia

Re: How to disable lock file creation

Post 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
Cheers
David
OS - Slackware 15 64 bit
Apache OpenOffice 4.1.15
LibreOffice 24.2.1.2; SlackBuild for 24.2.1 by Eric Hameleers
User avatar
RoryOF
Moderator
Posts: 34586
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: How to disable lock file creation

Post 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.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
John_Ha
Volunteer
Posts: 9583
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: How to disable lock file creation

Post 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.
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
Bill
Volunteer
Posts: 8932
Joined: Sat Nov 24, 2007 6:48 am

Re: How to disable lock file creation

Post 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.
AOO 4.1.14 on Ubuntu MATE 22.04
User avatar
AOOisdead
Banned
Posts: 32
Joined: Wed Mar 27, 2019 12:25 am

Re: How to disable lock file creation

Post 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.
Libreoffice 6.2.2
Bill
Volunteer
Posts: 8932
Joined: Sat Nov 24, 2007 6:48 am

Re: How to disable lock file creation

Post 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.
AOO 4.1.14 on Ubuntu MATE 22.04
User avatar
Zizi64
Volunteer
Posts: 11352
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: How to disable lock file creation

Post 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.
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
John_Ha
Volunteer
Posts: 9583
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: How to disable lock file creation

Post 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".
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
amsharma
Posts: 11
Joined: Sun Jul 27, 2014 2:44 pm

Re: How to disable lock file creation

Post 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.
OpenOffice 4.1.3 on Windows 10 (64bit)
John_Ha
Volunteer
Posts: 9583
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: How to disable lock file creation

Post by John_Ha »

Unfortunately correct as AOO is effectively dead. LO is under active development.
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
User avatar
RusselB
Moderator
Posts: 6646
Joined: Fri Jan 03, 2014 7:31 am
Location: Sarnia, ON

Re: How to disable lock file creation

Post by RusselB »

If I was a doctor and OO was my patient, I wouldn't call the patient deceased, but (probably) in coma.
OpenOffice 4.1.7, LibreOffice 7.0.1.2 on Windows 7 Pro, Ultimate & Windows 10 Home (2004)
If you believe your problem has been resolved, please go to your first post in this topic, click the Edit button and add [Solved] to the beginning of the Subject line.
User avatar
Lupp
Volunteer
Posts: 3542
Joined: Sat May 31, 2014 7:05 pm
Location: München, Germany

Re: How to disable lock file creation

Post 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.
On Windows 10: LibreOffice 24.2 (new numbering) and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
User avatar
AOOisdead
Banned
Posts: 32
Joined: Wed Mar 27, 2019 12:25 am

Re: How to disable lock file creation

Post 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.
Libreoffice 6.2.2
amsharma
Posts: 11
Joined: Sun Jul 27, 2014 2:44 pm

Re: How to disable lock file creation

Post 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.
OpenOffice 4.1.3 on Windows 10 (64bit)
Locked