very short pipeShell program
WhatMeWorry via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Sun Jun 22 17:01:39 PDT 2014
After hours of reading (obviously not comprehending) std.process
and looking at code samples, I still can't even do something this
simple. Open a Windows command line and run miscellaneous
commands. Only the first command, dir" is shown in the final
output.
auto pipe = pipeShell("dir", Redirect.all);
pipe.stdin.writeln("cd");
pipe.stdin.writeln("whomai");
pipe.stdin.flush();
pipe.stdin.close();
foreach(str; pipe.stdout.byLine)
writefln("from shell: %s",str);
I tried putting the wait() command was well in various places. to
no avail.
More information about the Digitalmars-d-learn
mailing list