System.IO.IOException: because it is being used by another proces

G

Guest

When i was trying to recursively delete a directory:

Directory.Delete(mydirectory,true);

It threw the following exception for a lot of files:

System.IO.IOException: The process cannot access the file "abc.xsl" because
it is being used by another process.

Upon further examincation, it is found that these files are all zero-byte
empty files.

Someone suggested that it might be caused by aggressive AV programs, so i
disabled AV on the box and retried, but still got the same errors.

Any clue on what might be the problem? It is running .NET 1.1 on Windows
2003 standard edition.

Thanks!
 
L

Lloyd Dupont

maybe they are in a network shared directory? and windows simply lost count
of how many network user are usin it!
try reboot!
 
A

alex

Hello Lloyd,

I believe that Windows will not allow you to delete a file if that file is
accessed by someone.
Does the code work on a directory without files? If it does not work on any
directory, then maybe there is something wrong with the code.

Help this helps :),
Alex.
 

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