[Mono-bugs] [Bug 55112][Nor] New - Mono produces different output compared to .Net for Directory.GetLogicalDrives()

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Wed, 3 Mar 2004 10:02:09 -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 jonathan.cooper@syntegra.com.

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

--- shadow/55112	2004-03-03 10:02:09.000000000 -0500
+++ shadow/55112.tmp.5996	2004-03-03 10:02:09.000000000 -0500
@@ -0,0 +1,74 @@
+Bug#: 55112
+Product: Mono/Class Libraries
+Version: unspecified
+OS: 
+OS Details: XP SP1 with mono 0.30.0
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: System
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: jonathan.cooper@syntegra.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Mono produces different output compared to .Net for Directory.GetLogicalDrives()
+
+Description of Problem:
+Mono produces different output compared to .Net for
+Directory.GetLogicalDrives(). Only the c:\ and a:\ drives are displayed by
+mono however .Net displays all drives including mapped network shares
+
+Steps to reproduce the problem:
+1. Use the following code:
+
+using System;
+using System.IO;
+
+namespace test
+{ 
+   class drives
+   {
+      [STAThread]
+      static void Main(string[] args) 
+      {
+	 string[] drives = Directory.GetLogicalDrives();
+	 foreach(string drive in drives)
+	    Console.WriteLine("Disk:  {0}",drive);
+
+	 string mydrive = Console.ReadLine();
+
+	 if(mydrive.Length != 0)
+	 {
+	   foreach(string d in Directory.GetDirectories(mydrive))
+	      Console.WriteLine("Dir:  {0}",d);
+
+	   Console.Read();  //pause when not run from cmd
+	 }
+      }
+   }
+}
+
+2. compile using:   mcs drives.cs /out:drives_mono.exe 
+   compile using:   csc drives.cs /out:drives_ms.exe
+
+3. run drives_mono.exe under the .Net framework, and enter "C:\" when the
+program pauses (note the correct directories are displayed)
+
+4. run drives_mono.exe using mono drives_mono.exe, and enter "c:\" when the
+program pauses (note the directories listed are incorrect, and the notation
+is missing the required \ before the directory name)
+
+5. repeat 3 and 4 using drives_ms.exe
+
+6. note the improper output provided by mono
+
+7. observe there is no difference in outputs between the _mono and _ms
+compiled executables
+
+
+Additional Information:
+The GetLogicalDrives() method is merely hacked to return A:\ and C:\ on
+Windows, although it is not described as incomplete in the documentation.