<p>To make a file completely deleted, we must have the last open file handle.  If we open the file non-exclusively, we cannot assure that and must always use slower rename and unlink.  If there is a way to make sure we have the last open handle, we can avoid exclusive open totally.  Can you suggest any?</p>

<p>Win32 API is unclear about hard links and the effect of the DELETE_ON_CLOSE flag.  If the flag is set and all open handles are closed, the file must be deleted according to the description, but if a handle is opened from another hard link, nothing is described about what happens.  I could be confused.  Apparently the flag must be set on the hard link not on the file itself.</p>

<p>We could add FLAG_SHARE_DELETE to make deletion of other hard links possible, but if any file handles with DELETE access might remain too long (I think unlikely), the file name (or hard link) can remain longer than we want.  Any solution here?</p>