[Mono-bugs] [Bug 38940][Wis] New - Directory.CreateDirectory fails when the directory already exists

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
Sat, 1 Mar 2003 04:47:58 -0500 (EST)

Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by gert.driesen@pandora.be.


--- shadow/38940	Sat Mar  1 04:47:58 2003
+++ shadow/38940.tmp.31780	Sat Mar  1 04:47:58 2003
@@ -0,0 +1,51 @@
+Bug#: 38940
+Product: Mono/Class Libraries
+Version: unspecified
+OS Details: Windows 2000
+Status: NEW   
+Priority: Wishlist
+Component: CORLIB
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: gert.driesen@pandora.be               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+Summary: Directory.CreateDirectory fails when the directory already exists
+Description of Problem:
+System.IO.Directory.CreatDirectory fails when the directory that you 
+specified already exists.  On the .NET Framework runtime this does not 
+cause an exception, it is considered successfull.
+Steps to reproduce the problem:
+1. (On Windows) Create a directory "C:\TEST"
+2. Execute the following code :
+System.IO.Directory.CreatDirectory("C:/TEST"); // I use a forward slash, 
+because Mono throw another exception when I use a backslash, bug filed for 
+Actual Results:
+You get the following exception :
+System.IO.IOException: Win32 IO returned ERROR_ALREADY_EXISTS
+in <0x00042> 00 System.IO.Directory:RealCreateDirectory (string)
+in <0x0024c> 00 System.IO.Directory:CreateDirectory (string)
+in <0x000e9> 00 log4net.Appender.FileAppender:OpenFile (string,bool)
+in <0x00050> 00 log4net.Appender.FileAppender:ActivateOptions ()
+Expected Results:
+The CreateDirectory should be considered successfull, when the directory 
+that you wanted to create already exists.
+How often does this happen?