[Mono-bugs] [Bug 58575][Nor] New - Process.Start() should consider PATH directories (or somewhat similar)

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Sun, 16 May 2004 11:30:15 -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 atsushi@ximian.com.

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

--- shadow/58575	2004-05-16 11:30:15.000000000 -0400
+++ shadow/58575.tmp.30604	2004-05-16 11:30:15.000000000 -0400
@@ -0,0 +1,70 @@
+Bug#: 58575
+Product: Mono: Class Libraries
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: System
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: atsushi@ximian.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Process.Start() should consider PATH directories (or somewhat similar)
+
+Currently Mono assumes System.Diagnostics.Process's process name
+as a file name. But MS.NET can execute not only files in current directory
+but also executables in PATH directories and shell commands such as "dir".
+
+
+using System;
+using System.Diagnostics;
+
+public class Test
+{
+        public static void Main ()
+        {
+                Console.WriteLine ("csc");
+                Process.Start ("csc");
+                Console.WriteLine ("csc.exe");
+                Process.Start ("csc.exe");
+                Console.WriteLine ("mono-api-info");
+                Process.Start ("mono-api-info");
+                Console.WriteLine ("dir");
+                Process.Start ("dir");
+                // should not exist
+                Console.WriteLine ("such-command-does-not-exist");
+                Process.Start ("such-command-does-not-exist");
+        }
+}
+
+(I ran this example program on WinXP where I have csc.exe and
+mono-api-info.exe in my PATH (including that is inherited from cygwin).
+
+
+Actual Results:
+Host Windows outputs localized message indicating "'XXX' is not recognized
+as either of internal commands, external commands, executable programs or
+batch files" (where XXX is either of "csc", "csc.exe", "mono-api-info",
+"dir" or "such-command-does-not-exist").
+
+
+Expected Results:
+csc
+csc.exe
+mono-api-info
+dir
+such-command-does-not-exist
+
+Unhandled Exception: System.ComponentModel.Win32Exception: [Localized
+windows message indicating "Specified file was not found."]
+   at System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo
+startInfo)
+   at System.Diagnostics.Process.Start()
+   at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
+   at System.Diagnostics.Process.Start(String fileName)
+   at Test.Main()