[Mono-devel-list] [MonoDevelop] MonoDevelop on MAC OS X [Working]
Herr Witten
lingwitt@bellsouth.net
Thu, 10 Jun 2004 06:44:56 -0400
There is definite weirdness, because here is my sample program, which
doesn't choke even when file = something that doesn't exist:
using System.IO;
using System.Diagnostics;
class HelloWorld
{
static void Main()
{
string file = "gtk-sharp";
ProcessStartInfo si = new ProcessStartInfo("pkg-config",
"--variable=libdir " + file);
System.Console.WriteLine(si.FileName + " " + si.Arguments);
si.RedirectStandardOutput = true;
si.RedirectStandardError = true;
si.UseShellExecute = false;
Process p = new Process();
p.StartInfo = si;
for (int i = 0; i < 1000; i++)
{
try{p.Start();}
catch (System.ComponentModel.Win32Exception e)
{
System.Console.WriteLine(e.Message);
}
p.WaitForExit ();
System.Console.WriteLine(p.StandardOutput.ReadToEnd
().Trim ());
}
}
}
On 10 Jun 2004, at 3:47, Todd Berman wrote:
> Not sure, can one of our resident MacOSX hackers chime in with some
> info here?
>
> --Todd
>
> Herr Witten wrote:
>> It turns out the problem is that the process to be run cannot be
>> found, yet when I make a simple program that starts a process as does
>> MonoDevelop, I get the right results. Why would work for my program,
>> but not yours?
>> _______________________________________________
>> Monodevelop-list mailing list
>> Monodevelop-list@lists.ximian.com
>> http://lists.ximian.com/mailman/listinfo/monodevelop-list
>