{{tag>category:"OpenInsight 32-bit" author:"Nick Stevenson" author:"bob carten"}} [[https://www.revelation.com/the-works|Join The Works program to have access to the most current content, and to be able to ask questions and get answers from Revelation staff and the Revelation community]] ==== Lock on OS file (OpenInsight 32-bit) ==== === At 25 JUN 2021 10:16:19AM Nick Stevenson wrote: === Hi I am using an OLE navigator control to display an image file, the process will eventually require an osdelete on that image file. If another user is presently displaying that same file, the osdelete fails with status 5 (Unknown error) - presumably because the OS has a lock on that file. So I am looking for a method to determine if the file is locked at OS level before displaying it, to prevent such behaviour. Has anyone dealt with this before and if so are you willing to share your solution? Thanks, Nick ---- === At 25 JUN 2021 10:22AM bob carten wrote: === I think OsOpen will do it for you OSOPEN file to hfile then osClose hfile isDeletable = true$ end else isDeletable = false$ end if isDeletable then osDelete file end ---- === At 25 JUN 2021 11:40AM Nick Stevenson wrote: === Thanks Bob, I'll be trying that right away. Nick [[https://www.revelation.com/revweb/oecgi4p.php/O4W_HANDOFF?DESTN=O4W_RUN_FORM&INQID=WORKS_READ&SUMMARY=1&KEY=188E2F834C3DE845B418DA4992E0E0A4|View this thread on the Works forum...]]