Advertisement
Guest User

Untitled

a guest
Aug 27th, 2015
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
D 0.44 KB | None | 0 0
  1. import core.thread;
  2. import std.stdio;
  3. import std.process;
  4. import std.string;
  5.  
  6. int main() {
  7.     auto pipes = pipeProcess("./target", Redirect.stdout);
  8.     write("./target started at PID ");
  9.     writeln(pipes.pid().processID);
  10.  
  11.     File target_stdout = pipes.stdout();
  12.  
  13.     while (true) {
  14.         write(target_stdout.readln());
  15.  
  16.         if (tryWait(pipes.pid()).terminated) {
  17.             break;
  18.         }
  19.     }
  20.  
  21.     return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement