On 12/15/06, Luciano Callero <[EMAIL PROTECTED]> wrote: > Hi: > I'm using mono 1.1.17.1. > I have a problem with System.IO.Directory.CreateDirectory method. > The problem is: if i create a file in somewhere with some name, and then > create a folder in the same place with the same (file) name, the folder is > not created (wich is correct) but no exception is throw. This is correct? > (If i create first the directory and then the file, the > System.IO.File.Create method throw a correct System.IO.IOException). > The code to test is: > > namespace test > { > class MainClass > { > public static void Main(string[] args) > { > File.Create("/tmp/test"); > Console.WriteLine(String.Format("File Exists? {0}", > File.Exists("/tmp/test").ToString())); > Directory.CreateDirectory("/tmp/test"); // An > IOException must be throw > here. > Console.WriteLine(String.Format("Folder Exists? {0}", > Directory.Exists("/tmp/test").ToString())); > > } > } > } > > > Do i fill a bug report? is it correct this behavior?
Just checked on MS.Net 2.0, an exception is thrown when you try to create a directory with a same name as file. I guess we have to stick with MS behaviour, not MSDN, if they differ. So this is a bug. _______________________________________________ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list