all groups > dotnet clr > april 2006 >
You're in the

dotnet clr

group:

problem with file handles


Re: problem with file handles Chris
4/4/2006 9:38:36 AM
dotnet clr:
[quoted text, click to view]

You are saying that you are calling the Close method and the system is
not releasing the file?

problem with file handles SharpCoderMP
4/4/2006 3:09:29 PM
hi,

in my app i monitor the filesystem for changes with FileSystemWatchers.
When the change is detected the app performs some actions using Shell32
to obtain information from the filesystem. now the problem is that
apparently the CLR not always closes the file handles immediately.
this is rather annoying to the user because he's unable to change
(write, delete, rename) these locked files or directories. the strangest
thing is that some handles are closed at once and some not - this is
totally random. sometimes it takes few minutes before the handle is
closed even if my app does not need those files anymore.

so the question is, how can i force my app to close those unused file
AddThis Social Bookmark Button