Read-only problems

Discuss the word processor
Post Reply
spursystarman
Posts: 18
Joined: Wed Dec 07, 2016 1:59 am

Read-only problems

Post by spursystarman »

Hi,
I love OO and recommend it to my students rather than MS office (I teach IT to retired folks) but there's just one thing about writer that annoys me! Opening files often brings them up as read-only - even if I look at the file in wins explorer and see that its attribute is NOT read-only. If I open from File-Open and the 'read-only' box is unticked it can still say 'read-only' after opening! Of course one can get round this by (sometimes repeatedly) hitting the 'pencil-edit' icon and/or 'sections' but surely one should not have to do this at all - so 2 questions:
1) Why does this happen at all? Surely if one opens a WP file the main reason will be to do something to it, so such files should be writable by default rather than the reverse.
2) Is there thus any way to permanently make all WP files writable?
openoffice 4.1.2 on windows 7
User avatar
Hagar Delest
Moderator
Posts: 32655
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: read-only problems

Post by Hagar Delest »

There are quite a few topics on that. I've never seen any acceptable explanation.
See [rel=search.php?keywords="read+only"+solved&terms=all&author=&sc=1&sf=all&sr=topics&sk=t&sd=d&st=0&ch=300&t=0&submit=Search]this query[/rel]
Have found perhaps these ones more specifically:
- [Solved+Issue] Writer Document "Read only"
- [Solved] New laptop: docs read only, can't assert ownership
LibreOffice 7.6.2.1 on Xubuntu 23.10 and 7.6.4.1 portable on Windows 10
User avatar
RoryOF
Moderator
Posts: 34612
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Read-only problems

Post by RoryOF »

A file may be marked "Read0only" on reopening if the computer was powered down or hibernated too speedily, before the internal housekeeping was correctly written to disk. Enable "Viewing of hidden and system files" (words to that effect) and you may find lock files left, either in the OO user profile or in the directory in which the R/O file was saved. These files are written to prevent multiple instances of the program attempting to make changes - only the first user to open the program has read-write rights; when one of these files is left, OO thinks that the file is already in use and prevents the next user writing to the file.

The lock files have names similar to this

Code: Select all

.~lock.MyFile.odt#
If you are certain that the file is not in use by another user, such lock files may safely be deleted if OO is closed.

If they exist regularly after an editing session it is usually a matter of user education to prevent their continued existence - instruct users to use the formal computer shutdown procedure and wait ten or so seconds for the internal write buffers in the hard disks to flush to disk before turning the power off or unplugging computer from the electricity supply.

They can also be left after a computer or program crash; hopefully, these are very occasional occurrences.
 Edit: it is worth mentioning that the lock files are typically only a few hundred bytes, whereas the "owning" file will be a minimum of 6KB; anyone deleting such lock files should take heed of this, to ensure that the main file is not deleted. There is unfortunately an increasing tendency for "rampant clickitis" among less experienced and new computer users, which can lead to deletion of the wrong file. 
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
spursystarman
Posts: 18
Joined: Wed Dec 07, 2016 1:59 am

Re: Read-only problems

Post by spursystarman »

Thanks everyone. At least I'm not the only one to have encountered this problem! I am the only user (I don't even log in to windows) and have enabled displaying file types. So I will take a look at the links suggested. As a developer myself (VB6, PHP, asp, vb.net) I wonder if the 'read-only' business can not be omitted from future versions of OO?
Happy birthday to all in the 100 acre wood!
openoffice 4.1.2 on windows 7
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Read-only problems

Post by Villeroy »

spursystarman wrote:As a developer myself (VB6, PHP, asp, vb.net) I wonder if the 'read-only' business can not be omitted from future versions of OO?
OpenOffice is not able to change any file attributes. If a file on the file system is read-only, then because some other program or Windows component has decided that this should be a read-only file. Particularly when you load some file from the network for viewing, the other program (brower, mail client) saves a temporary and read-only copy of the document. This is intended by the other program and happens before the file is loaded into the office suite.

When OpenOffice opens a document for editing, it creates a so called "lock file" in the same directory as the opened file. The lock file of "MyDocument.odt" is named ".~MyDocument.odt#", which is the name of the edit file with a leading .~ and trailing #. The lock file prevents that 2 different processes edit the same file simultaniously which may lead to complete loss of data. When some program opens MyDocument.odt while a lock file .~MyDocument.odt# exists, the program should open the file in read-only mode. OpenOffice issues a warning that some other user is editing the file in question right now.
When the program which created the lock file terminates ungracefully (crash, power outage, sudden shut down of operating system), the lock file remains in place. When you get a message about missing access rights and you are sure that nobody but you is working on the document in quesion, then close the program, find the lock file and delete it. You may need to tell your file manager to show hidden files before you can see any lock files.

If a document has been flagged as read-only, this flag has beed intentionally added by the document's author. The flag is somewhere in the document and not on system level.
The solution is the same in both cases: just hit the edit button
If it is a read-only file, then you get an editable but yet unsaved copy for editing and you will prompted for a new path name when closing the edited file.
If it is a read-only document, the document may prompt for a password if the author set one. The password protected read-only flag is child protection, easy to overcome.

Furthermore, there are incomprehensible "security" tools (anti-virus? don't know) running on the Windows platform which restrict all write access of all programs that have not been white-listed somehow. Don't ask me about that, but it has more to do with the "enemies" of OpenOffice rather than OpenOffice itself.
Last edited by Villeroy on Sat Jan 27, 2018 6:10 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
chuanist
Posts: 11
Joined: Sun Nov 26, 2017 8:16 am
Location: Berkeley, California USA

Re: Read-only problems

Post by chuanist »

I have encountered this or a similar manifestation too. My research indicates that 'file locking' is turned on by default, and can only be turned off by editing a script that, on my system, does not seem to be editable.

See: 'About Open Office' under the Open Office menu in the top menu. Click on 'Licence' in the resulting window to read about file locking.
OpenOffice 4.1.5 for the Mac

Running on Mac OS 10.9.5 (for the graphics apps)
User avatar
RoryOF
Moderator
Posts: 34612
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Read-only problems

Post by RoryOF »

If file locking from OpenOffice is causing the problem, it is because an earlier file lock was left in position, frequently because of a program or computer crash, or sometimes an over-hasty power off of the computer before OO's housekeeping was finally written to disk. Close OpenOffice, enable "Viewing of hidden and archive files" (words to that effect) at system level and delete and lock file shown in the directory in which the problem file lives. Also delete any lock file shown in the root of the OO User Profile.

All should now be well.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
chuanist
Posts: 11
Joined: Sun Nov 26, 2017 8:16 am
Location: Berkeley, California USA

Re: Read-only problems

Post by chuanist »

Dear Rory—

Thanks for your help. If I may ask, I don't understand the following: '...delete and lock file shown in the directory in which the problem file lives.' What do you mean by 'delete and lock file'?

Thanks again,

Glen
OpenOffice 4.1.5 for the Mac

Running on Mac OS 10.9.5 (for the graphics apps)
User avatar
RoryOF
Moderator
Posts: 34612
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Read-only problems

Post by RoryOF »

This was a typo, now corrected. Should read "delete any lock file"
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
Arnold45
Posts: 2
Joined: Mon May 14, 2018 1:20 pm

Re: Read-only problems

Post by Arnold45 »

Really glad to see this thread! I suggest you must be aware of any instance of your locked files elsewhere (connected and synchronized external drive, synchronized cloud drives). Delete all *.ods# files before starting Writer (and/or Calc?!) and opening your then 'freed' files. It took me hours before I met the solution.
OpenOffice 4.1.5 on Windows 10
Post Reply