I'm coding in "C" and I am using the PIPE method to invoke the running of a gzip command from another program. Its a backup program and part of the program is to verify the integrity of the gzipped backup file. To do this I try to execute the command:
"gzip -vt <backupfile>.tar.gz" via opening a PIPE.
The pipe opens and executes this command fine however the resulting output doesn't get sent back up the PIPE to my program, it just gets printed out in the shell. E.g. "<backupfile>.tar.gz: OK" shows on the screen, but my program doesn't get this output sent back to it. So my program never knows the result of this test. How can I get my program to read this shell outputted result?
Any help greatly appreciated.