I'm running an executable in Linux in the terminal like so:
./foo 1 2 3 >output.txt
The results are not outputted to output.txt, even though the file is created but doing &>output.txt
instead does the trick. So I guess the response of ./foo is defined as stderr??
But moving on.. my objective is to call that ./foo program within C multiple times but I'm not managing to get the output to a file when I do this:
status=system("./foo 1 2 3 &>output.txt")
The output only appears in the Eclipse console but the file is indeed created but remains empty. (I also tried >
only)
Any idea on what I'm doing wrong?