in reply to STDOUT Issues

The backticks should cause the program to wait until the command is done, you shouldn't have to wait until you can open the output file. Anyway, can't you just redirect the output of the command:
system("command arg1 arg2 >/dev/null 2>&1");