_popen alternative in D?

Maraco darkandan at windowslive.com
Thu Jul 21 06:19:12 PDT 2011


Hello.

I have a specific problem. I need to redirect console output from a
console program to dfl textbox but i cant find function to do it.
std.process.system only shows exiting code. I think
std.process.shell should do it but it is crashing whole program.

If You don't know what im asking for there's code how i've done it
in C#:

*CODE BEGINS
Process p = new Process();
            p.StartInfo.FileName = "shutdown";
            p.StartInfo.Arguments = " /?";
            p.StartInfo.UseShellExecute = false;
            p.StartInfo.RedirectStandardOutput = true;
            p.StartInfo.CreateNoWindow = true;
            p.Start();

            string output = p.StandardOutput.ReadToEnd();

            textBox3.Text = output;
*CODE ENDS

Can you provide me an idea what im doing wrong or alternative to
popen in D langauge?

Regards.


More information about the Digitalmars-d mailing list