title: PHP: failed to open stream: File exists
body: <p>From a similar question I used this code to debug the failure of opening a file</p>
  
  <pre><code>echo'&lt;pre&gt;';
  error_reporting(E_ALL);
  ini_set('display_errors', true);
  echo 'phpversion: ', phpversion(), "\n";
  echo 'uname: ', php_uname("s r"), "\n"; // name/release of the operating system
  //echo 'sapi: ', php_sapi(), "\n";
  echo $file, file_exists($file) ? ' exists' : ' does not exist', "\n";
  echo $file, is_readable($file) ? ' is readable' : ' is NOT readable', "\n";
  echo $file, is_writable($file) ? ' is writable' : ' is NOT readable', "\n";
  $fp = @fopen($file, 'x');
  if (! $fp) {
      echo 'last error: ';
      var_dump(error_get_last());
  }
  echo '&lt;/pre&gt;
  </code></pre>
  
  <p>I get this helpful message</p>
  
  <pre><code>D:\data\openid\nonces\4d895d80---2jmj7l5rSw0yVb.vlWAYkK.YBwk-Bk0DdMtjVYDVZi0npvGwNNFSRy0
  
  phpversion: 5.3.1
  uname: Windows NT
  D:\data\openid\nonces\4d895...FSRy0 exists
  D:\data\openid\nonces\4d895...FSRy0 is readable
  D:\data\openid\nonces\4d895...FSRy0 is writable
  last error: array(4) {
    ["type"]=&gt;
    int(2)
    ["message"]=&gt;
    string(188) "fopen(D:\data\openid\nonces\4d895d80---2jmj7l5rSw0yVb.vlWAYkK.YBwk-Bk0DdMtjVYDVZi0npvGwNNFSRy0) [function.fopen]: failed to open stream: File exists"
    ["file"]=&gt;
    string(38) "D:\web\library\Utils.php"
    ["line"]=&gt;
    int(179)
  }
  </code></pre>
  
  <p>"failed to open stream: File exists"  - What could that mean?</p>