Unable to delete file locked by same process -- weird!
Posted
by user300266
on Stack Overflow
See other posts from Stack Overflow
or by user300266
Published on 2010-03-23T19:50:08Z
Indexed on
2010/03/23
19:53 UTC
Read the original article
Hit count: 276
I have an application written in PHP that uses a COM dll written in C#. The dll creates an image file by combining two other image files. The PHP script then takes over to do the housekeeping tasks of deleting the two source files and renaming the resulting combined file. The problem is the PHP script can't delete one of the source files because it's locked. The weird thing is that the process that has it locked is itself which in this case is the Apache Web Server. I have tried altering the C# dll to dispose of all bitmap and graphics objects prior to exiting, and yet the lock remains. My question is, what can I do to get the dll to let go and release the file locks. This is very frustrating.
© Stack Overflow or respective owner