[Mono-bugs] [Bug 38939][Wis] New - Directory.CreateDirectory issue on Windows

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
Sat, 1 Mar 2003 04:41:03 -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.

http://bugzilla.ximian.com/show_bug.cgi?id=38939

--- shadow/38939	Sat Mar  1 04:41:02 2003
+++ shadow/38939.tmp.22305	Sat Mar  1 04:41:02 2003
@@ -0,0 +1,62 @@
+Bug#: 38939
+Product: Mono/Class Libraries
+Version: unspecified
+OS: 
+OS Details: Windows 2000
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: CORLIB
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: gert.driesen@pandora.be               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Directory.CreateDirectory issue on Windows
+
+Description of Problem:
+
+When I try to create a directory using the static Createdirectory method 
+of the Directory class, an exception is thrown because the path is parsed 
+incorrectly.  Apparently the CreateDirectory (and probable other methods 
+too) doesn't support the \ directory separator character.
+
+I assume the Createdirectory does not use the Path.DirectorySeparatorChar 
+internally to parse the directory supplied.
+
+Steps to reproduce the problem:
+1. Use Mono on Windows (2000)
+2. execute the following method : 
+
+System.IO.Directory.CreateDirectory(@"C:\TEST");
+
+or 
+
+System.IO.Directory.CreateDirectory(@"C:" + Path.DirectorySeparatorChar 
++ "TEST");
+
+Actual Results:
+
+Both will fail and the following exception will be reported :
+
+Unhandled Exception: System.IO.DirectoryNotFoundException: Directory "\T" 
+not found.
+in <0x0005d> 00 System.IO.Directory:SetCurrentDirectory (string)
+in <0x003e9> 00 System.IO.Directory:CreateDirectory (string)
+in <0x00421> 00 System.IO.Directory:CreateDirectory (string)
+in <0x00153> 00 AlexCF.EntryPoint:Main (string[])
+
+Expected Results:
+
+I would expect the diretory C:\TEST to be created if I doesn't already 
+exist.
+
+Everything works fine when you specify C:/TEST as directory name, but on 
+Windows the backslash should be supported as well.  The 
+Path.DirectorySeparatorChar does return the correct character.
+
+How often does this happen? 
+
+Always