title: How can someone corrupt an NTFS filesystem with a user space application
body: <p>So the question may look strange. 
  I've encountered many times a folder that cannot be deleted on a NTFS filesystem unless the PC was rebooted. When this happens, the issue is not a permission things, even the local administrator can't deal with it. But reboot the PC and the folder is gone.</p>
  
  <p>Even this <a href="https://support.microsoft.com/en-ca/help/320081/you-cannot-delete-a-file-or-a-folder-on-an-ntfs-file-system-volume" rel="nofollow noreferrer">Microsoft post</a> says that it is a possible behaviour</p>
  
  <p>Now, I have an application that creates a temporary folder, write inside it and deletes it afterward. Sometime, this application crashes because it cannot delete the files inside that folder. When I look at it, the temporary folder is empty and show the behaviour described above.</p>
  
  <p>So my question goes as follow : How can my software do that? 
  I would like to debug this but I have no clue where to start as I would expect the filesystem to be robust when accessed through the WinAPI. My application is a C# .Net 4.5 application.</p>
  
  <p>Is there known vulnerabilities on the NTFS filesystems that could result in bad sectors? We're talking about Windows 7. This looks a lot like a race condition scenario.</p>
  
  <p>Thanks!</p>