title: PHP filemtime function - "stat failed for"
body: <p>I have a problem with PHP filemtime function. In my webapp I use Smarty template engine with caching option. In my webapp I can do some actions which generate error, but lets focus on only one action. When I click link on page some content is updated - I can click few times and everything is OK but about one request on 10 fails. Following error occurs:</p>
  
  <pre><code>filemtime() [&lt;a href='function.filemtime'&gt;function.filemtime&lt;/a&gt;]: stat failed for
  </code></pre>
  
  <p>and the line that causes the problem:</p>
  
  <pre><code> return ($_template-&gt;getCachedFilepath() &amp;&amp; file_exists($_template-&gt;getCachedFilepath())) ? filemtime($_template-&gt;getCachedFilepath()) : false ;
  </code></pre>
  
  <p>As you can see, file exists because it is checked.</p>
  
  <p>Problematic line of code is included in <code>smarty_internal_cacheresource_file.php</code> (part of Smarty lib v3.0.6)</p>
  
  <p>App is run on UNIX system, external hosting.</p>
  
  <p>Any ideas? Should I post more details?</p>