title: Success/failure of linux command executed inside system command in C
body: <p>I'm trying to execute a linux tar command inside a C system() function. It goes like this : </p>
  
  <pre><code>if (-1 == system("tar -xf files.tar.gz file1")) {
      printf("tar failed\n");
  }
  </code></pre>
  
  <p>If there is no "file1" inside "files.tar.gz", the program doesn't print "tar failed". How do I identify if the command executed inside system() has failed?</p>