Ask Your Question
0

Files completely locked

asked 2016-08-01 20:00:54 +0200

OTEB gravatar image

I use Libreoffice on Ubuntu 16 at work and when I open a shared file (shared via CIFS on Windows Server), the file stay completely locked and my co-workers are unable to open that file untill I close it. When we open the same files using Microsoft Office, it opens as read-only normally. Is there some way that I can configure my libreoffice to act like that, allowing other to open an already opened file as read-only?

Thank you guys and sorry for any typo.

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2016-08-24 02:30:04 +0200

mark_t gravatar image

You could open the documents as a template, this creates a new read/write file with a copy of the existing read only document. If you need to save changes you have to write to a new file and then resolve differences with the original.

Linux bash file, you could use open with and select the bash file. This checks if the lock file exists, if it does it gives a warning notification and opens the file as a template, otherwise it just opens the file read/write.

#!/bin/bash
arg=$1
path=${arg%\/*.*}\/
file=${arg#$path}
lock=$path.~lock.$file#

if [ -e "$lock" ]
then
notify-send -t 0 "$1 This file is open and locked for editing. Opened Read Only by LibreOffice."
/usr/lib/libreoffice/program/soffice.bin -n "$1"
else
/usr/lib/libreoffice/program/soffice.bin "$1"
fi
edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2016-08-01 20:00:54 +0200

Seen: 101 times

Last updated: Aug 24 '16