Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import core.thread;
- import std.stdio;
- import std.process;
- import std.string;
- int main() {
- auto pipes = pipeProcess("./target", Redirect.stdout);
- write("./target started at PID ");
- writeln(pipes.pid().processID);
- File target_stdout = pipes.stdout();
- while (true) {
- write(target_stdout.readln());
- if (tryWait(pipes.pid()).terminated) {
- break;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement