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.



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

Comments are closed

Copyright © 2000 - 2024 , Excentrics World