eWorld.UI - Matt Hawley

Ramblings of Matt

System.IO Woes

March 3, 2004 22:51 by matthaw

I've been working on a Web Deployer windows application the last week or so, and everything was working great until I refactored some code the other night.  In a separate thread, I'm traversing through a directory (and subdirectories) getting the size of all the files needing to be copied.  Just after that, I start traversing through that same directory, attempting to copy the file to a destination. However, after refactoring code into 1 method for all the traversing, I've been unable to copy any of the files, and am getting a "The process cannot access the file ... because it is being used by another process."

If you have any idea or could help me out, that would be great.


Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Categories: .NET
Actions: E-mail | Permalink | Comments (2) | Comment RSSRSS comment feed

Comments

March 4. 2004 00:42

Are you disposing of the objects after you are done with them?

Robert McLaws

March 4. 2004 00:44

I would, if FileInfo and DirectoryInfo had a .Dispose method.



Its odd, however...



The code works split out (which is what I reverted back to using), but within 1 method, it doesn't.

Matt Hawley

Add comment


 

  Country flag

[b][/b] - [i][/i] - [u][/u]- [quote][/quote]



Live preview

January 6. 2009 02:24



Copyright © 2000 - 2009 , Excentrics World