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