La communication à travers un pipe ne se fait pas.
Kelkun pourrait-il m'aider ?
int fds[2]; int f= open("fichier", O_RDONLY); pid_t p;
pipe(fds);
p= fork();
if( p > 0 ) { char buf[1024]; int n;
while( (n= read(f, buf, 1024)) > 0 ) write(fds[1], buf, n);
close(f); close(fds[1]); } else if( p == 0 ) { dup2(fds[0], 0); execv("lpr", 0); }
|
Core Breaker 