[Mono-dev] System.IO.Directory.CreateDirectory bug!

Luciano Callero lnc19 at hotmail.com
Fri Dec 15 17:09:44 EST 2006

   I'm using mono
   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)
			Console.WriteLine(String.Format("File Exists? {0}", 
			Directory.CreateDirectory("/tmp/test"); // An IOException must be throw 
			Console.WriteLine(String.Format("Folder Exists? {0}", 


Do i fill a bug report? is it correct this behavior?

Thanks in advanced

Visita MSN Latino Noticias: Todo lo que pasa en el mundo y en tu paín, ¡en 
tu idioma! http://latino.msn.com/noticias/

More information about the Mono-devel-list mailing list