>How can I track if a file is opened by another program, before I delete it.
You could also just go ahead and delete it, and use ON ERROR to see whether it was really deleted or not.
Something like:
local lcError, llDeleteFailed
lcError = on("error")
on error llDeleteFailed = .T.
erase MyFile
on error &lcError
if llDeleteFailed
MessageBox("Can't delete file.")
endif
Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)