file_exists on high load system
<p>The code:</p>

<pre><code>$tmp_file_path = '/path/to/tmp/file';

// move file from tmp dir
$new_file_path = '/path/to/new/location/file';
while(file_exists($new_file_path)){
  $new_file_path = $new_file_path . microtime(true);
  usleep(100000);
}

// HERE ANOTHER INSTANCE OF THIS SCRIPT COULD HAVE ALREADY TAKEN NEW NAME,
// $new_file_path
// BUT NEXT CALL TO rename function OVERWRITES IT WITH NEW CONTENT!

rename($tmp_file_path, $new_file_path ); //Attempts to rename oldname to newname,
// moving it between directories if necessary. If newname exists, it will be
// overwritten. 
</code></pre>

<p>What solution is there in PHP to make <code>file_exists</code> function create a file, if it doesn't exist, like <code>touch</code> does, in one <strong>atomic</strong> operation?</p>
