Re: Directory Ops Behaving Asynchronous
Ryan Heath <[email protected]> Mon, 19 May 2008 21:54:56 +0200
| Newsgroups | gmane.comp.windows.devel.dotnet.clr |
|---|---|
| Message-ID | <[email protected]> |
I cannot speak for Dir.Del but another thing to consider: Are there other threads/progs deleting/creating that dir? // Ryan 2008/5/19, Brady Kelly <[email protected]>: > 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 > > Chase Software > Office: 011 287 1820 > Cell: 078 331 3781 > Fax: 086 691 5653 > > <http://www.chasesoftware.co.za/> www.ChaseSoftware.co.za > > > > > =================================== > This list is hosted by DevelopMentor(R) http://www.develop.com > > View archives and manage your subscription(s) at http://discuss.develop.com > =================================== This list is hosted by DevelopMentorĀ® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com