title: Could DropBox interfere with DeleteFile()/rename()
body: <p>I had the following code which got executed every two 
  minutes all day long:</p>
  
  <pre><code>int sucessfully_deleted = DeleteFile(dest_filename);
  
  if (!sucessfully_deleted)
  {
      // this never happens
  }
  
  rename(source_filename,dest_filename);
  </code></pre>
  
  <p>Once every several hours the rename() would fail with errno=13 (EACCES). The files involved were all sitting on a DropBox directory and I had a hunch that DropBox could be the cause. I figured that it might just be possible that the DeleteFile() function may return with a non-zero successfully_deleted but actually DropBox could still be busy doing some stuff in relation to the deletion that prevented rename() from succeeding. What I did next was to change rename() to my_rename() which would attempt a rename() and upon any failure would Sleep() for one second and try a second time. Sure enough that has worked perfectly ever since. What's more, I get a diagnostic message displaying first-attempt-failures every several hours. It has never failed on the second attempt.</p>
  
  <p>So you could say that the problem is entirely solved... but I would like to understand what might be going on so as to better defend myself against any related DropBox issues in the future...</p>
  
  <p>Really I would like to have a new super_delete() function which does not return until the file is <em>properly</em> deleted and finished with in all respects.</p>