I think there is no way to delete an opened file, but you may check if the file is open before you try to delete it.
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.