title: IOException with File.Copy() inspite of prior File.Exists() check
body: <p>This is pertaining to a simple file copy operation code. My requirement is that only new files be copied from the source folder to the destination folder, so before I copy the file, I check that:</p>
  
  <ul>
  <li>it exists in the source folder</li>
  <li>it does not exist in the destination folder</li>
  </ul>
  
  <p>After this I proceed with the copy operation.<br>
  However, I randomly get an IOException stating that "The file &lt;filename> already exists."<br>
  Now, I have this code running (as part of a win service) on 2 servers so I'm willing to concede that maybe, just maybe, within that short interval where Server1 checked the conditions and proceeded to copy the file, Server2 copied it to destination, resulting in the IOException on Server1.<br>
  But, I have several thousands of files being copied and I get this error in thousands. How is this possible? What am I missing? Here's the code:</p>
  
  <pre><code>try
  {
      if(File.Exists(String.Format("{0}\\{1}",pstrSourcePath,strFileName)) &amp;&amp; !File.Exists(String.Format("{0}\\{1}",pstrDestPath,strFileName)))
              File.Copy(String.Format("{0}\\{1}",pstrSourcePath,strFileName),String.Format("{0}\\{1}",pstrDestPath,strFileName))     
  }
  catch(IOException ioEx)
  {
      txtDesc.Value=ioEx.Message;
  }
  </code></pre>