   System() calls going awry
  I am trying to write a GUI wrapper for a command line application using I/O redirection to collect the output. Basically I'm trying to do:system("\"Frequency Analysis.exe\" \"C:\\Some\\Path\\To\\File.wav\" > log.txt");and then read in the output from log.txt. Unfortunately, whilesystem("\"Frequency Analysis.exe\" > log.txt");works just fine, system("\"Frequency Analysis.exe\" \"anything\" > log.txt");reports that 'Frequency' is not recognized as an internal or external command blah blah blah (only if I redirect stderr with 2>, since that would be printed on the error console).Is this a bug in... something (compiler, C runtime library, etc)? Or am I doing something stupid?Thanks!   
  system() is an ugly hack. If I were you, I'd just write a generic function to start a new process that uses handles given by me for stdout using system calls (or whatever they're called on Windows) and then just do something like:int fd = open("log.txt", O_CREAT, 0644);int status = 0;int pid = runProcessWithMyStdout("Frequency Analyzer.exe", fd);waitpid(pid, &status, 0);Of course, you'd probably use something other than open and waitpid on Windows. (CreateProcess and WaitForSingleObject, perhaps?)   