Bug 154980 - From Linux open document already opened in Windows
Summary: From Linux open document already opened in Windows
Status: UNCONFIRMED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
7.6.0.0 alpha0+
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-04-24 09:47 UTC by Timur
Modified: 2023-04-25 12:06 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Timur 2023-04-24 09:47:55 UTC
In GUI we can open a document that is already opened in other program, if we choose Read-only or Copy. 

If we use Commandline/headless to start LO, and a document is already opened in other program, we get "General input/output error while accessing document". 

There should be a way to open document. Simple approach would be to open read-only with "soffice" and copy with "soffice -n".

Commandline bugs are important for LO QA. In this case, we may have reference program opening document, and opening the same one in LO bibi repos.
Comment 1 Mike Kaganski 2023-04-24 11:16:19 UTC
Please clarify which exact command line should work differently, when the file referenced in that command line is opened. Also please mention which other application has that document open, because that could affect reproducibility: e.g., notepad on Windows doesn't lock its open files; LibreOffice has relaxed its locking of opened files in ~recent versions, etc.

As far as I see it, a command line like

  soffice path/to/document

is exactly in the same what is used to open the GUI (so would work exactly the same way, showing a confirmation dialog when the default open mode is unavailable).

"Commandline/headless" might refer to use of --headless switch; but that needs the exact command line that uses it, and fails.

  soffice path/to/document --headless

This command line fails e.g. when document is an XLS, and it is opened in MS Excel on my system: the default open mode for XLS is "open for editing", and it is unavailable, and there's no GUI available. In a script (which is what headless mode is primarily designed for), failure to execute the command as specified is a hard failure, so IMO nothing to change.

This command line succeeds for me:

  soffice -n path/to/document --headless

and the program starts without the GUI, but with a new document created based on the document, even when the document is opened in MS Excel.

I used Version: 7.5.3.1 (X86_64) / LibreOffice Community
Build ID: d29ee673721b12c92b3de9b9663473211414f0db
CPU threads: 12; OS: Windows 10.0 Build 19045; UI render: default; VCL: win
Locale: ru-RU (ru_RU); UI: en-US
Calc: CL threaded
Comment 2 Timur 2023-04-24 13:57:52 UTC Comment hidden (obsolete)
Comment 3 Mike Kaganski 2023-04-24 14:01:09 UTC
(In reply to Timur from comment #2)
> NOK (and bug): soffice -n path/to/document when document is open in MSO

I can't repro this, either:

I open an XLS file in MS Excel 2016. Then I run this exact command line:

  "C:\Program Files\LibreOffice\program\soffice" -n D:\Downloads\lessons.xls

and it opens a new document based on that XLS fine. The LO version is as in comment 1.
Comment 4 Timur 2023-04-24 14:03:32 UTC
NOK: soffice -n path/to/document from Linux, when document is open in MSO in Windows.
Now I see this may also be my local issue. 

I confirm that this works: soffice -n path/to/document --headless.
Also opening with office path/to/document (with or without -n) works in the same system.
Comment 5 Timur 2023-04-25 12:06:03 UTC
Actually, commandline behaves similar to GUI, so problem here is Linux-Windows.