title: Duplicating file pointers?
body: <p>Just a quick question: Is there a way to duplicate a file pointer (those returned by <code>fopen()</code>), similar to how <code>dup()</code> duplicates a file handlers returned by functions like <code>open()</code>?</p>
  
  <p>Basically, I want to be able to do something like this:</p>
  
  <pre><code>FILE *fp = fopen("some_file", "r");
  FILE *fp2 = /* do something to duplicate the file pointer */;
  fclose(fp); // fp2 is still open
  /* do something with fp2 */
  fclose(fp2);
  </code></pre>