DirectoryInfo / FileInfo

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.
 
E

Eric Marvets

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>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top