How to check what LibreOffice closed readonly file

I write program what should opens files in external editor for editing or viewing (readonly).
Sometimes editor can be MS Office program, sometimes - LibreOffice.
All good for writable files. LibreOffice creates for it lock file.
But if file has readonly flag, LibreOffice does not create lock file.

I can not turn off readonly flag for file. I can not use -view parameter for LibreOffice.
I must move edited file or delete file after viewing, if it was opened in readonly mode.

P.S.
Sorry for my English.

If LibreOffice opens a file in read only it doesn’t need a lock file to prevent writing back to the same file.

If you want to open a read only file and allow changes to be made then perhaps try opening the file as a template. From command line or your program this would be:-

"C:\Program Files\LibreOffice 5\program\soffice" -n "D:\UserData\Mark\Desktop\Calc\Test6.ods"