title: Get pathinfo from an open file handle
body: <p>I'm reading data from a file and need to run checks on its extension </p>
  
  <p>I opened the file handle with fopen and given the handle to pathinfo()</p>
  
  <pre><code>$handle2 = fopen('files/ppGM.txt', 'r');
  $fileinfo = pathinfo($handle2);
  </code></pre>
  
  <p>I need the array of informations from path info but the functions requires the first parameter to be string:</p>
  
  <blockquote>
    <p>Warning: pathinfo() expects parameter 1 to be string, resource given in /home/kroman02/public_www/p1tma/index.php on line 21</p>
  </blockquote>