Re: Directory Ops Behaving Asynchronous
Davy J <[email protected]> Sat, 7 Jun 2008 17:22:08 +0200
| Newsgroups | gmane.comp.windows.devel.dotnet.clr |
|---|---|
| Message-ID | <[email protected]> |
Brad, I hit this a few years ago , if I remember correctly there was no solution, the only way was to itterate through the files collection and delete them individually. hth Davy J On Mon, May 19, 2008 at 7:42 PM, Brady Kelly <[email protected]> wrote: > I have the following code execute: > if (Directory.Exists(exportFolder)) > { > Directory.Delete(exportFolder, true); > } > Directory.CreateDirectory(exportFolder); > and then a database update, and then: > wiz57.PerformExport(); > Occassionally, about 1 in 20 tests I run in the IDE, PerformExport fails > because exportFolder does not exist. How can it not exist if I create it and > no exception is thrown? I can only suspect that the Directory code is not > truly synchronous, and has not completed before PerformExport executes. > > > > Brady Kelly > Software Developer > =================================== This list is hosted by DevelopMentorĀ® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com