This project is read-only.

Process access errors...

Oct 17, 2012 at 12:56 AM

I have a multi-threaded Winform application that uses the CDReader and UdfReader classes.

After creating an ISO, I try to delete the files from my work directory, but I get the following error:

The process cannot access the file '20121010134544-4427500.mp3' because it is being used by another process.

I placed the CDReader instance in a using statement and even tried calling the Dispose method, but the error persists.

If I run the application and bypass the ISO creation step, the files can be deleted without any problem.

Any advice would be appreciated.

Rick

 

Oct 18, 2012 at 7:55 PM

Update:

After further review, I found the issue in another library - this library uses Marshal.ReleaseComObject() and it *appears* to be the reason for the file access issue.

Since commenting out the code that invokes this method I haven't encountered the file access issue.

This link goes into detail about the use of this method and the possible side effects:

http://blogs.msdn.com/b/visualstudio/archive/2010/03/01/marshal-releasecomobject-considered-dangerous.aspx

I will continue researching this matter!

Rick

Oct 20, 2012 at 10:26 AM

Rick,

Searching through the current source code, there's nothing that matches 'ReleaseComObject' - so I'm not sure about that part.

So long as you dispose of the stream created by CDBuilder, it should close all open file handles.

 

The code does open the files for 'exclusive' read access right now, so I've checked in change 91aeb0ba2841, which might help if you're trying to build multiple CD images at the same time from the same source files.

 

Ken