Re: Intermittent Incorrect Result on System.IO.Directory.Exists
Brady Kelly <[email protected]>
| Newsgroups | gmane.comp.windows.devel.dotnet.advanced |
|---|---|
| Message-ID | <[email protected]> |
> I suspect that this is the same thing you had before, namely that a
> directory was being deleted, but not all file handles against the
> directory had been closed yet. In that case, the remove-directory is
> queued and will execute when the last handle is closed. If during that
> queued-delete time, you check if the directory exists it will return
> FALSE, but if you try to create the directory it will already exist.
>
> Make sure all your file access streams/handles are properly being
> disposed... I recommend a using(Stream file = xxx) { } block.
>
> Marc
In this case the directory doesn't get deleted. As I said in an earlier post, this all works nicely when deployed to the web server, so I'm going to concentrate on progress there. A working system is a much higher priority than identifying random, failure conditions.
===================================
View archives and manage your subscription(s) at http://peach.ease.lsoft.com/archives