title: Why isn't PHP filesize() function working?
body: <p>I noticed that filesize doesn't work when I'm trying to list the contents of a directory using a path like this:</p>
  
  <pre><code>../
  </code></pre>
  
  <p>for example this works:</p>
  
  <pre><code>if ($handle = opendir('./')) {
      while (false !== ($file = readdir($handle))) {
          if ($file != "." &amp;&amp; $file != "..") {
  
              echo "File Name: $file | File Size: ". filesize($file)."&lt;br /&gt;";            
  
          }
      }
      closedir($handle);
  }
  </code></pre>
  
  <p>but this doesn't:</p>
  
  <pre><code>if ($handle = opendir('../')) {
      while (false !== ($file = readdir($handle))) {
          if ($file != "." &amp;&amp; $file != "..") {
  
              echo "File Name: $file | File Size: ". filesize($file)."&lt;br /&gt;";            
  
          }
      }
      closedir($handle);
  }
  </code></pre>
  
  <p>In the last example the file names are listed fine but instead of getting their file size I get this error:</p>
  
  <pre><code>Warning: filesize() [function.filesize]: stat failed for dynamic.php in C:\xampp\htdocs\app_file_manager\panel\index.php on line 65
  </code></pre>
  
  <p>Is there a way to get the 2nd example to work?</p>