[Mono-bugs] [Bug 56993][Nor] New - Mono should autoconvert '\' to '/' in pathnames

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Wed, 14 Apr 2004 09:30:20 -0400 (EDT)


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 sam_bravard@yahoo.com.

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

--- shadow/56993	2004-04-14 09:30:20.000000000 -0400
+++ shadow/56993.tmp.11379	2004-04-14 09:30:20.000000000 -0400
@@ -0,0 +1,65 @@
+Bug#: 56993
+Product: Mono: Class Libraries
+Version: unspecified
+OS: All
+OS Details: Unix
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: System
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: sam_bravard@yahoo.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Mono should autoconvert '\' to '/' in pathnames
+
+Description of Problem:
+
+Mono's file libraries should handle backward-slash "\" to "/" forward-
+slash conversions automatically.  (Otherwise mono will forever be a second 
+class .net platform that has to be 'ported' to).  .NET already handles '/' 
+correctly so both platforms would be content and we could start sharing 
+more and 'porting' less.
+
+Steps to reproduce the problem:
+1. Use "\" in a file op on Unix
+
+Actual Results:
+
+Lookup failure.
+
+Expected Results:
+
+Successful access.
+
+How often does this happen? 
+
+Everytime.
+
+Additional Information:
+
+Using 'File.pathSeparator' in strings is too cumbersome.  There needs to 
+be a better way to make it easy for people to write cross platform code.
+
+Microsoft's file libraries already convert '/' to '\' automatically in 
+file paths making the two equivalent.
+
+Mono should consider the same idea to allow both '/' and '\' as path 
+separators.
+
+Suggestion:
+
+Just add auto "\" -> "/" conversion for any low-level libs that use 
+filesystem paths.  (suggested approach)
+
+Note:
+
+Microsoft did this with their C runtime to convert '/' -> '\' for 
+DOS/Windows.  This was to make it possible to migrate UNIX file code to 
+DOS/Windows without having users spend forever converting path names.
+
+I think it would be acceptable to let mono do the opposite.  Then on both 
+platforms either slash would work and everyone would be happy.