[Mono-bugs] [Bug 71214][Maj] New - No way to express backslashes with DirectoryInfo

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Wed, 12 Jan 2005 15:58:57 -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 joeshaw@novell.com.


--- shadow/71214	2005-01-12 15:58:57.000000000 -0500
+++ shadow/71214.tmp.18490	2005-01-12 15:58:57.000000000 -0500
@@ -0,0 +1,30 @@
+Bug#: 71214
+Product: Mono: Class Libraries
+Version: 1.1
+OS Details: 
+Status: NEW   
+Priority: Major
+Component: CORLIB
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: joeshaw@novell.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+Summary: No way to express backslashes with DirectoryInfo
+The backslash is a valid character in unix filenames, but if you try to use
+them in mono, they are implicitly converted to forward slashes, causing
+tracebacks and such later when you try to manipulate them.
+The DirectoryInfo constructor calls Path.GetFullPath, which calls
+Path.CanonicalizePath, which in Step 3 splits on both the
+DirectorySeparatorChar and the AltDirectorySeparatorChar, which is the root
+of the problem.  When it puts the path back together, the backslashes are
+replaced with forward slashes.
+Attached is a test case which shows the problem.  The expected output (at
+least for the first two) should really be "/test/one\two\three/four"