On Mon, 09 Aug 2010, Jan Dubois wrote: > On Mon, 09 Aug 2010, Ben Morrow wrote: > > IIRC the equivalent of Unix' close-behind on Win32 is a flag that will > > cause the OS to delete the file when it gets closed. That sounds exactly > > right for this situation (better, in fact, than close-behind, since the > > file needs a name to get renamed). The flag would have to be cleared > > just before renaming, of course, which still leaves a small race > > I believe there is no API that lets you revert the FILE_FLAG_DELETE_ON_CLOSE bit Some quick browsing on MSDN also lets me believe that you cannot combine the DELETE access mode with any other kind of access if you are on Windows 2000/XP/2003 and are opening a remote file (i.e. by UNC name). So in that case we would still have to manually delete the file ourselves once we are done with it (and leaking it in case we are crashing). Maybe everything should just stay the way it is right now. :) Cheers, -JanThread Previous | Thread Next