[Ohrrpgce] [ohrrpgce/ohrrpgce] Temporary directories sometimes not cleaned on Windows (`killdir` fails) (#39)

Ralph Versteegen notifications at github.com
Sat Sep 14 21:49:10 PDT 2019


For a long time we've worked around `killdir` sometimes failing to cleanup working.tmp on Windows, leaving one or more files in the directory, by trying to clean it up next time instead. There also used to be some bugs causing files or directories to be undeletable, e.g. because SDL_mixer or DIR (which internally keeps a persistent handle returned by FindFiles) held them open, but no such unfixed bugs are known to me.

Someone mentioned that using Distribute Game sometimes doesn't clean up its temp directory afterwards.

I think what is causing killdir to fail is that an external program, namely a virus scanner or file indexer, is momentarily reading a file after we write, the same cause as bug #36. However this problem will need to be worked around separately.

Normally when you try to delete a file Windows marks it for deletion once everyone has closed it (unless someone opens it without `FILE_SHARE_DELETE`, in which case `DeleteFile` fails). I wonder if it has an API for deleting directories that works similarly. But most likely we just have to try again later if deleting the directory or a file in it failed.


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/ohrrpgce/ohrrpgce/issues/39
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.motherhamster.org/pipermail/ohrrpgce-motherhamster.org/attachments/20190914/56cef82f/attachment.html>


More information about the Ohrrpgce mailing list