title: Mimic File.Move if the destination already exists
body: <p>From the documentation of <a href="http://msdn.microsoft.com/en-us/library/system.io.file.move.aspx"><code>File.Move</code></a>:</p>
  
  <blockquote>
    <p>Note that if you attempt to replace a file by moving a file of the same name into that directory, you get an IOException. You cannot use the Move method to overwrite an existing file.</p>
  </blockquote>
  
  <p>In short, you can't overwrite on <code>Move</code>, so in order to facilitate overwriting on Move I mimic the behavior by doing a <code>File.Copy</code> followed by a <code>File.Delete</code>. Something like:</p>
  
  <pre><code>if (File.Exists(dstFileName))
  {
      // System.IO.File.Move cannot be used to overwrite existing files, so we're going
      // to simulate that behavior with a Copy &amp; Delete.
      File.Copy(procContext.FileName, dstFileName);
      File.Delete(procContext.FileName);
  }
  else
      File.Move(procContext.FileName, dstFileName);
  </code></pre>
  
  <p>My question is: Are there any situations that I need to guard against which could lead to the source file being deleted without it first being successfully copied? </p>
  
  <p>My understanding from reading the documentation is that since <code>File.Copy</code> doesn't return anything that it should throw an exception in any case that it doesn't succeed. Has anyone encountered any situations where this isn't true?</p>