[Mono-osx] Calling ls with wildcards

Andrew Ayre andy at britishideas.com
Wed Sep 14 08:19:02 EDT 2011


The following fills the result string with a list of items in /dev:

ProcessStartInfo EnumProcessInfo = new ProcessStartInfo("ls", "/dev");
EnumProcessInfo.CreateNoWindow = true;
EnumProcessInfo.UseShellExecute = false;
EnumProcessInfo.RedirectStandardOutput = true;
Process EnumProcess = Process.Start(EnumProcessInfo);
string Result = EnumProcess.StandardOutput.ReadToEnd();

If I change the first line to the following then the result is empty:

ProcessStartInfo EnumProcessInfo = new ProcessStartInfo("ls", "/dev/*");

What am I doing wrong?

I am using the current version of MonoMac and MonoDevelop (downloaded
yesterday) on SnowLeopard.

thanks, Andy

More information about the Mono-osx mailing list