Problem came when I tried fgetc/fputc or fgets/fputs to
achieve same transfer. I used fdopen(pipe_fd,"r") to get the pipe stream
for the file functions, but obviously I miss something:
1 2 3 4
int c;
while( (c = fgetc(fdopen(fd[0],"r"))) != EOF){
fputc(c,outfile);
}
... have you considered the fact that you are creating an arbitrary number of FILE* objects that are never closed or even considered after one use? Maybe that’s a problem?