title: Redirect output of process ran by execv
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/8516823/redirecting-output-to-a-file-in-c">redirecting output to a file in C</a>  </p>
  </blockquote>
  
  
  
  <p>I'm running a process as follows:</p>
  
  <pre><code>char* [NUM];
  char[0] = processName;
  char[1] = arg0;
  ...
  char[NUM] = 0;
  execv(args[0],args);
  </code></pre>
  
  <p>The question is how I can make it redirect its output to </p>
  
  <pre><code>/dev/null
  </code></pre>
  
  <p>I tried adding it to the args array but it sent it as arguments to the program...</p>
  
  <p>Any idea anyone?</p>
  
  <p>Thanks</p>