I need to write a program that create pipe send filename from command line to child process. In child read that file and send it back using pipe. Parent process should print
This code does not compile:
while (fgets(buff, sizeof(buff), file) != NULL) { write(pipefd[1], "Error reading file", 18); } else { write(pipefd[1], buff, sizeof(buff)); }
You can't have an else clause there.
else