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.
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
NOK (and bug): soffice -n path/to/document when document is open in MSO I confirm that this works: soffice -n path/to/document --headless.
(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.
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.
Actually, commandline behaves similar to GUI, so problem here is Linux-Windows.