[Solved] Locked for Editing

Discuss the word processor

[Solved] Locked for Editing

Postby brdwtchr » Thu Jan 21, 2021 4:25 pm

All of a sudden, many if not all my files are "locked for Editing". As far as I know, I did nothing....I am a very inexperienced computer user and I cant seem to figure out how to fix this. I have uninstalled OO and nothing changed. I need a really "simple" answer "well explained" if possible. I may have to go to another application or purchase the MS Office suite....yikes....
Last edited by Hagar Delest on Fri Jan 22, 2021 6:28 pm, edited 1 time in total.
Reason: tagged solved.
OpenOffice 4.1.8 on windows 10
brdwtchr
 
Posts: 9
Joined: Thu Jan 21, 2021 4:21 pm

Re: Locked for Editing

Postby FJCC » Thu Jan 21, 2021 5:09 pm

OpenOffice is not closing files correctly for some reason. When OpenOffice opens a file, it writes a tiny temporary file that records which file is being edited. This temporary file should be removed when the original file is closed. If it is not removed, then the next time you try to open the original file, OpenOffice will think it is being edited by someone and display the "file locked for editing" message.

The first thing to do is to delete all of the temporary files. They have names that start with .~lock. and they are normally hidden from view. You should open the folder that contains the file you are trying to edit, set it to display hidden files and then delete all of the files whose name starts with .~lock. To show the hidden files, click on the View tab of the window displaying the folder contents and click on the box labeled Hidden Items. I have highlighted that box in red in the image below.
HiddenItems.PNG

You can also see at the bottom of the image a file named .~lock.dummy.xlsx#. I have a file named dummy.xlsx open and that is its temporary file.

After cleaning up the lock files, you should be able to edit your files. You should then consider why these temporary files are not being deleted. One possibility is that you are closing the file and then very quickly shutting down the computer. If so, give OpenOffice a few seconds to do its internal clean up. another possibility is that OpenOffice is crashing a lot. Have you had that problem?
Windows 10 and Linux Mint, since 2017
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
FJCC
Moderator
 
Posts: 8165
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Locked for Editing

Postby brdwtchr » Thu Jan 21, 2021 5:18 pm

I opened my 'documents' folder, the 'hidden items' box is checked. There are no files like what you mention.
OpenOffice 4.1.8 on windows 10
brdwtchr
 
Posts: 9
Joined: Thu Jan 21, 2021 4:21 pm

Re: Locked for Editing

Postby FJCC » Thu Jan 21, 2021 6:05 pm

Try to make a new document and save it in the same folder as your other documents. While it is open, do you see the .~lock file? If you close it, does the .~lock file disappear?
Windows 10 and Linux Mint, since 2017
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
FJCC
Moderator
 
Posts: 8165
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Locked for Editing

Postby brdwtchr » Thu Jan 21, 2021 6:10 pm

Yes, i see a file like that.....Would post screen shot if I could figure that out.......I closed the file and when I open the documents folder, the 'locked' file shows up
OpenOffice 4.1.8 on windows 10
brdwtchr
 
Posts: 9
Joined: Thu Jan 21, 2021 4:21 pm

Re: Locked for Editing

Postby brdwtchr » Thu Jan 21, 2021 6:12 pm

Ooops, when I closed the file, the 'locked' file does not show up in the list....when I try to open the file, I get the locked message....grrrrrr
OpenOffice 4.1.8 on windows 10
brdwtchr
 
Posts: 9
Joined: Thu Jan 21, 2021 4:21 pm

Re: Locked for Editing

Postby RoryOF » Thu Jan 21, 2021 6:14 pm

Are you working to the local hard drive, or to a USB or networked drive, or to the cloud?
Apache OpenOffice 4.1.10 on Xubuntu 20.04.2 (mostly 64 bit version) and very infrequently on Win2K/XP
User avatar
RoryOF
Moderator
 
Posts: 32659
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Locked for Editing

Postby brdwtchr » Thu Jan 21, 2021 6:16 pm

Local hard drive
OpenOffice 4.1.8 on windows 10
brdwtchr
 
Posts: 9
Joined: Thu Jan 21, 2021 4:21 pm

Re: Locked for Editing

Postby RoryOF » Thu Jan 21, 2021 6:27 pm

Try deleting or renaming your OpenOffice User Profile. Details of how to do this are set out on
Resetting the user profile

If you have custom dictionaries or extensions installed, renaming is best -user.old is a good choice. Otherwise, just delete it.

On next start of OpenOffice you will be prompted for name and initials. If you are not, you got the renaming or deletion process wrong.
Apache OpenOffice 4.1.10 on Xubuntu 20.04.2 (mostly 64 bit version) and very infrequently on Win2K/XP
User avatar
RoryOF
Moderator
 
Posts: 32659
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Locked for Editing

Postby RoryOF » Thu Jan 21, 2021 7:31 pm

Just to confirm: when you deleted or renamed your OpenOffice user profile, you were prompted for your name and initials on next start of OpenOffice?
Apache OpenOffice 4.1.10 on Xubuntu 20.04.2 (mostly 64 bit version) and very infrequently on Win2K/XP
User avatar
RoryOF
Moderator
 
Posts: 32659
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Locked for Editing

Postby Bill » Thu Jan 21, 2021 9:17 pm

FJCC wrote:When OpenOffice opens a file, it writes a tiny temporary file that records which file is being edited. This temporary file should be removed when the original file is closed. If it is not removed, then the next time you try to open the original file, OpenOffice will think it is being edited by someone and display the "file locked for editing" message.

In my experience, the message does not appear if the same user tries to open the original file. It does appear when a different user tries to open the file. The message that appears is titled "Document in Use" The full message is:

Code: Select all   Expand viewCollapse view
"Document file '<file name> is locked for editing by:
<account username> (<date & time)
Open document read-only or open a copy of the document for editing."

If "unknown user" appears in the message instead of the account username, then the problem is probably not related to lock files, but may be caused by the antivirus or ransomware protection settings in the operating system. In that case, the antivirus and ransomeware settings must be changed.
AOO 4.1.10 on Ubuntu MATE 21.04
Bill
Volunteer
 
Posts: 8283
Joined: Sat Nov 24, 2007 6:48 am

Re: Locked for Editing

Postby John_Ha » Thu Jan 21, 2021 9:39 pm

FJCC wrote:When OpenOffice opens a file [fred.odt], it writes a tiny temporary file [.~lock.fred.odt#]that records which file is being edited. This temporary file should be removed when the original file is closed. If it is not removed, then the next time you try to open the original file, OpenOffice will think it is being edited by someone and display the "file locked for editing" message.

I thought that too as many of my forum replies will attest :crazy:

I did a test. I opened fred.odt and moved .~lock.fred.odt# out of the folder. I closed fred.odt and put .~lock.fred.odt# back into the folder. I then opened fred.odt.

I was expecting that the presence of .~lock.fred.odt# would cause AOO 4.1.8 to complain that fred.odt was open for editing and AOO would ask if I wanted to edit a copy. I was surprised that AOO said nothing, allowed me to edit fred.odt, and then allowed me to save it!

So how does AOO check if a file is open and being edited by another user? It must be Bill's suggestion that it only works if another user on the PC tries to open it.
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.
John_Ha
Volunteer
 
Posts: 8464
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: Locked for Editing

Postby RoryOF » Thu Jan 21, 2021 9:52 pm

You have to log on as a different User, John. I suggest you edit the lock file (plain text editor will do), and change your name and logon name to something else. Save the lock file. Then Open the main file as you; and it will pick up tat the lock file exists and inform you that the main files is locked for editing by whoever you changed the name/user to, suggesting it be opened read-only or as a copy.
Apache OpenOffice 4.1.10 on Xubuntu 20.04.2 (mostly 64 bit version) and very infrequently on Win2K/XP
User avatar
RoryOF
Moderator
 
Posts: 32659
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Locked for Editing

Postby John_Ha » Thu Jan 21, 2021 10:04 pm

Rory

I have just done the test and I can confirm that. I logged John out of Windows and logged back in as my Test user. I then got the locked for editing message.

.~lock.fred.odt# contains

Code: Select all   Expand viewCollapse view
John ,Lounge-PC/John,LOUNGE-PC,21.01.2021 20:01,file:///C:/Users/John/AppData/Roaming/OpenOffice/4;

where both occurrences of John must be my Windows name John, and not my AOO name.

I have been wrong all these years - you could blow me down with a feather :oops:
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.
John_Ha
Volunteer
 
Posts: 8464
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: Locked for Editing

Postby RoryOF » Thu Jan 21, 2021 10:07 pm

John_Ha wrote:Rory

I have been wrong all these years - you could blow me down with a feather :oops:


Even Homer nods!
Apache OpenOffice 4.1.10 on Xubuntu 20.04.2 (mostly 64 bit version) and very infrequently on Win2K/XP
User avatar
RoryOF
Moderator
 
Posts: 32659
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Locked for Editing

Postby Bill » Fri Jan 22, 2021 12:21 am

John_Ha wrote:I did a test. I opened fred.odt and moved .~lock.fred.odt# out of the folder. I closed fred.odt and put .~lock.fred.odt# back into the folder. I then opened fred.odt.

I was expecting that the presence of .~lock.fred.odt# would cause AOO 4.1.8 to complain that fred.odt was open for editing and AOO would ask if I wanted to edit a copy. I was surprised that AOO said nothing, allowed me to edit fred.odt, and then allowed me to save it!

So how does AOO check if a file is open and being edited by another user? It must be Bill's suggestion that it only works if another user on the PC tries to open it.

Do the same test again, but after pasting the lock file back in the folder, open the lock file with a text editor and change the account username in the lock file and save it, then try to open the original file. You should then get the message saying that the file locked for editing by the user whose account username you entered in the lock file. As a third test, leave the account username blank in the lock file before opening the original file. You should then get the message saying that the file is locked for editing by "unknown user". However, I don't know how an account could have no username. That's why I think "unknown user" in the message indicates an external problem, not a lock file problem.
AOO 4.1.10 on Ubuntu MATE 21.04
Bill
Volunteer
 
Posts: 8283
Joined: Sat Nov 24, 2007 6:48 am

Re: Locked for Editing

Postby John_Ha » Fri Jan 22, 2021 12:55 am

Bill wrote:Do the same test again ...

Bill

That's exactly what happened. I edited it and changed both John above to, quelle surprise, Fred. On opening it I got the message below saying Fred was editing it.

Clipboard01.png

When I changed only the first John to four spaces, it opened OK.

But when I changed both occurrences of John to four spaces I got the message below:

Clipboard02.png
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.
John_Ha
Volunteer
 
Posts: 8464
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: Locked for Editing

Postby Bill » Fri Jan 22, 2021 3:10 am

John_Ha wrote:.~lock.fred.odt# contains

Code: Select all   Expand viewCollapse view
John ,Lounge-PC/John,LOUNGE-PC,21.01.2021 20:01,file:///C:/Users/John/AppData/Roaming/OpenOffice/4;

where both occurrences of John must be my Windows name John, and not my AOO name.

The first "John" should be the full name that is entered in the AOO/LO user data. That can be checked by opening files after changing the full name to something unique. "John" that appears after the first comma should be the account name in the operating system. That can be checked by opening files in different user accounts. I don't know about "Lounge-PC/" that precedes the second "John". Nothing like that appears on my system. "LOUNGE-PC" that appears after the second comma should be the computer name in the operating system. That should be self-evident if the computer name is unique.
AOO 4.1.10 on Ubuntu MATE 21.04
Bill
Volunteer
 
Posts: 8283
Joined: Sat Nov 24, 2007 6:48 am

Re: Locked for Editing

Postby brdwtchr » Fri Jan 22, 2021 5:05 pm

Thanks to everyone who tried to help me. I could not get AOO to work like it used to, so I have moved on to another package. Thanks Again....So Long....
OpenOffice 4.1.8 on windows 10
brdwtchr
 
Posts: 9
Joined: Thu Jan 21, 2021 4:21 pm

Re: [Solved] Locked for Editing

Postby Bill » Fri Jan 22, 2021 7:07 pm

Earlier you said that the lock files disappear when the original file is closed, so the problem is not getting AOO to work, it is getting your antivirus and ransomware setup properly.
AOO 4.1.10 on Ubuntu MATE 21.04
Bill
Volunteer
 
Posts: 8283
Joined: Sat Nov 24, 2007 6:48 am


Return to Writer

Who is online

Users browsing this forum: No registered users and 10 guests