DirectoryInfo / FileInfo

  • Thread starter Thread starter Jeff Gaines
  • Start date Start date
J

Jeff Gaines

I am writing a file manager that uses DirectoryInfo / FileInfo
to obtain details about files and folders that are then shown in
a ListView.

During testing I have found that I can't delete some files or
folders because 'another process is using them'.

I ran Process Explorer (by Mark Russinovich
www.sysinternals.com) and it shows that my app seems to have a
massive number of files and folders open which is a bit
worrying.

Do DirectoryInfo / FileInfo actually open files? If so how do I
close them?

If not I'll need to look elsewhere in the app.
 
You didn't mention opening any files with a FileStream, but that is usually
the cause of this. Make sure you are closing them when you are done.

--
Eric Marvets
Principal Consultant

the bang project

<shameless self promotion>

Email (e-mail address removed) for Information on Our Architecture and
Mentoring Services

</shameless self promotion>
 
Back
Top