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.