sorry, I did with O_RDONLY and it is ok now.
But I have a new problem.
I can send data to child process with write(fd[1], char_array, strlen(char_array);
I will use it in the child process to redirect the input stream to char_array.
BUT I need to redirect the input to a file not an array.
fid=fid2=open("yarrak.txt",O_RDONLY);
write(fd[1], fid2, 100); 100 is assuming in the file there at most 100 chars. But this doesn't work???
Last edited by haydari; 04-15-2007 at 10:05 AM.
|