Soffice script editing

I am having a problem that all of my LO data sets open as “locked for editing by unknown user”. A little research on the web led me to the Readme Libre Office published by libreOffice.org (Readme | LibreOffice - Free Office Suite - Based on OpenOffice - Compatible with Microsoft).

The file reads - File locking is enabled by default in LibreOffice. On a network that uses the Network File System protocol (NFS), the locking daemon for NFS clients must be active. 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 document.

I am using Windows 11 and have not been able to find the soffice script. Can someone point me in the right direction?

The soffice script would be the executable script invoking soffice.bin on Unix/Linux systems, I don’t think that’s applicable to the Windows environment (where it’s soffice.com and/or soffice.exe) and the NFS locking in that form doesn’t exist on Windows anyway.

However, I have no clue about Windows and what could cause this situation for all documents (for a single document I’d say you have a stale lock file (~lock.*.*#) lying around, but not for all documents). Maybe a read-only directory? Maybe someone else has an idea.

First step: close Libreoffice and examine the list of background processes in the Windows Task Manager. If LibreOffice is there, then the problem is solved.

Vladimir,

I checked Task Manager and LO was not running. However, I don’t follow that if LO is running then the problem would be solved. Does the fact that LO wasn’t there mean that the problem still exists? Is there a soffice.com or .exe that I should be looking for as erAck suggested? Any idea where it would be?

Maybe best to try looking for lock files first. In Windows, searching in File Explorer for even just ~lock. will not find any lock files. I use a program called “Everything” for search in Windows, it found 201 lock files but the overwhelming majority were in the recycle bin on a NAS.

It might be easiest to check by eye. Open File Explorer, select the View tab and tick the box Hidden items. Navigate to the folder where you have a locked file and look for a small file (±1kb) named ~lock.[filename.extension]# . If you haven’t got that file open currently, then just delete it. Check if file opens OK, see a new lockfile created, close the file and check that the lockfile is deleted on close. If all OK, close LO and delete all lockfiles that you can find

I did as suggested with File Explorer and did not see any locked files. I do see a ~lock file in the same directory as the original Calc file that I have opened, but no others.

I am still trying to find the office script file that is mentioned in the LibreOffice Readme file that I cited in my original post. I have found soffice.exe, but how do you edit that? What would an office script file look like?

This is on Windows 11.

Any suggestions?

You don’t.

That SAL_ENABLE_FILE_LOCKING environment variable isn’t even used on Windows, so forget about editing a script file that doesn’t exist.

Your problem is something else.

Maybe a third party anti-virus is locking the files. Some anti-ransomware settings lock files by changing file permissions. AVG and Avast seem to do this. If a program is added to their allowed list then that program can open and edit the files.
With that system, if you have a network of computer A, computer B and network storage N and a file on storage N is opened by computer A, computer A locks the file and computer B cannot edit that file. Because the permission has been changed, even if computer A is shut down, the file remains locked and computer B cannot access it.

I found I had to turn off anti-ransomware on computer A, and Restart computer A before the permissions were changed back. Once files were accessible again, I removed all anti-virus and re-instated Windows Defender. The anti-ransomware settings in Windows Defender block the program, not the file so settings on one computer affect only that computer and do not block other computers.

1 Like

Very interesting information about Avast and AVG. I will look to see if either of those are running. I have never used Defender, you may have convinced me to try it.