Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Start IPC here
- auto set1 = FileDescriptor.pipe2();
- auto set2 = FileDescriptor.pipe2();
- auto pid = Process.fork();
- if( pid == 0 )
- {
- Shdout.formatln("I am the child!");
- // Close stdin/stdout
- fds[0].close();
- fds[1].close();
- // Replace with pipe(r/w)
- set1[0].dup2( 0 );
- set2[1].dup2( 1 );
- set1[0].close(); set1[1].close();
- set2[0].close(); set2[1].close();
- Process.execve( "/usr/bin/md5sum", ["md5sum"], null );
- }
Advertisement
Add Comment
Please, Sign In to add comment