title: System.Data.SQLite and strange File.Copy errors
body: <p>I find that File.Copy will gladly copy a file onto itself without throwing an exception. By mistake I copied a sqlite database file onto itself, and the file is no longer a valid database. 
  I have repeated this as a test several times and get the same result. Using winmerge (or a text editor) I see that the result file has 0 bytes, but windows explorer still shows the original file size.
  What have I missed here?
  (vs2008, win7-64)</p>
  
  <p>Edit: some code. Pretty simplistic I know. And it's not 0 bytes, it's all nuls.</p>
  
  <pre><code>        public bool RestoreDatabaseSqlite(string backupFilePath)
      {
          try
          {
              File.Copy(backupFilePath, _databaseFilePath, true);
          }
          catch(Exception ex)
          {
              MessageBox.Show("Error restoring database file: " + ex.Message, "Database Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
              return false;
          }
  
          return true;
      }
  </code></pre>
  
  <p>Edit #2: The problem is specific to System.Data.SQLite, an open SQLiteConnection on the file, and the interaction with File.Copy. I would expect the file copy to fail with an exception, but it just silently nuls out the entire file.</p>