View Full Version : CoreConverter and Permission Denied

11-17-2007, 10:03 AM
In a threaded context, CoreConverter occassionally fails to close the file handle of the converted file such that delete operations (as in move operations) on the converted file fail with a "Permission Denied" error after CoreConverter has itself completed. I am using reference release 12.3 on a windows media player lossless to mp3 (-V 2) conversion.

To verify this, I ran a batch of conversions, and used process explorer to search for a part of one of the files' name in the handles search, and it returned an inactive CoreConverter process as the sole user of the file handle for the file name. Attempts to delete the file failed. Around 10 seconds after the CoreConverter process exits, the file may always be deleted, and searches for the file name in the handles search produces no result. In the majority of the cases, the file handle closes properly, and the file may be deleted immediately with no errors.

This causes me some trouble since I can't reliably move the file under these conditions. Is it possible that the handle is not being flushed prior to close the handle and exiting from CoreConverter? If some form of IO::Handle is being used, a call to flush might help? Perhaps some other idea?

11-17-2007, 03:25 PM
It is not possible for a program which has exited to leave open a file handle, you could even end task any program in the middle of a file write, Windows will always close the file handle.

12-10-2007, 12:08 PM
I'm a firm believer in that.. but perhaps the wma sdk (dll) has something open? In any case, I just wipe the temporary directory when complete. A scavenger process would also work.

12-10-2007, 03:40 PM
Visit Microsoft and search for process explorer, install it, then search for handle, type the filename and it will show the process with it open.