Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Is there a way to "force" a file to be deleted even if it is "...being used by another process."? I have tried both of these methods:

 

File.Delete(myFile)
'and
Kill(myFile)

 

I am closing all file and/or memory streams that opened the file origionally but it does not seem to have any effect on my ability to delete it. Am I missing something??

Being smarter than you look is always better than looking smarter than you are.
Posted

It's just an xml file. Once I'm done processing the information in it, I don't need it anymore so I'd like to discard it altogether. Is there a way to find out what process has it and then abort that process?

 

p.s. I like your avitar! ;)

Being smarter than you look is always better than looking smarter than you are.
Posted
Just noticed something strange about it as well, I will normally have multiple files in the directory to be deleted but, if there is only one file in the directory, it works just fine. Once there is a second file there, the first file causes an exception...very strange. I'll check out that process explorer though, thanks!
Being smarter than you look is always better than looking smarter than you are.
Posted
Just wanted to let y'all know that I resolved the issue. I used the Process Explorer and found what was using the file. Thanks all!
Being smarter than you look is always better than looking smarter than you are.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...