¡@

Home 

c++ Programming Glossary: pipe_read

Writing my own shell… stuck on pipes?

http://stackoverflow.com/questions/1461331/writing-my-own-shell-stuck-on-pipes

constants are better than magic numbers. const int PIPE_READ 0 const int PIPE_WRITE 1 int fd 2 pipe fd Now you can refer.. int PIPE_WRITE 1 int fd 2 pipe fd Now you can refer to fd PIPE_READ and fd PIPE_WRITE . Second suggestion Take a step back and think.. first child process which will dup2 it to 1 and pass fd PIPE_READ to the second child process which will dup2 it to 0. Simply..

Linux 3.0: Executing child process with piped stdin/stdout

http://stackoverflow.com/questions/9405985/linux-3-0-executing-child-process-with-piped-stdin-stdout

answer which I used in developing this one. #define PIPE_READ 0 #define PIPE_WRITE 1 int createChild const char szCommand.. redirect return 1 if pipe aStdoutPipe 0 close aStdinPipe PIPE_READ close aStdinPipe PIPE_WRITE perror allocating pipe for child.. child continues here redirect stdin if dup2 aStdinPipe PIPE_READ STDIN_FILENO 1 perror redirecting stdin return 1 redirect stdout..