SMBs

DIY: File locking in Open/LibreOffice

Jack Wallen answers a common question he's asked about Open/LibreOffice and file locking. The answer depends on the version you're running.

The influx of Open/LibreOffice questions are pouring in with good reason: The flagship open source office suite is a natural, powerful, and cost-effective alternative to Microsoft Office. One question I get is: Does Open/LibreOffice handle file locking?

First, I'll first explain what this question refers to for readers who may not know. When you have a shared directory housing documents that many people access, it's crucial that whatever application is used to edit the document honor file locking. A file lock prevents more than one user from opening that file with write permissions. If this mechanism wasn't in place, more than one person could open the same file and write to the file simultaneously. What changes would be honored?

Prior to Open/LibreOffice 3.0, file locking was an issue. In order to get this to work properly, you would have to make use of Samba and the oplocks = true directive, but this didn't always work (and was broken by Windows XP and OS X). The good news is that as of Open/LibreOffice 3.0 the office suite honors file locking, so you can rest assured that a file opened on a network would only be opened, with writer permissions, by only one user.

So, if you are using an out of date release of Open/LibreOffice (< 3.0), you need to update to the latest release as soon as possible to make sure you have file locking built in. Don't rely on Samba for file locking, or you might suffer from data loss and very unhappy users.

Ask Jack: If you have a DIY question, email it to me, and I'll do my best to answer it. (Read guidelines about submitting DIY questions.)

About Jack Wallen

Jack Wallen is an award-winning writer for TechRepublic and Linux.com. He’s an avid promoter of open source and the voice of The Android Expert. For more news about Jack Wallen, visit his website jackwallen.com.

Editor's Picks

Free Newsletters, In your Inbox