Interested in how to implement what you can do in the command prompt:ls > file1 > file2
If one file, then everything is clear: use dup2() to replace STDOUT_FILENO fd on the desired file, but if you need several...
The only thing I can think of is to run the child process, which will sit on the STDOUT_FILENO and manual...