Well it's fairly complicated and I can't really say it's correct right
now without testing it and checking a dozen things. Did we previously
name tmpdir differently on different OSes? Didn't the way tmpdir is
chosen change recently? But I don't think this code is going to go
badly awry, rather, like all our code, there are lots of edge cases
which may cause it to break and do nothing. I think it's safe enough.

I would suggest simplifying it a little by deleting other temp
directories after cleaning up our own tmpdir. However currently your
new findfiles still relies on a temporary file in findfiles, but I
wanted to remove that. Hey, speaking of that,
reset_game_final_cleanup() contains the following lines:

  cleanup_other_temp_files
  IF gam.autorungame THEN exitprogram (NOT abortg)
  cleanuptemp

which might explain why we end up with so many empty undeleted
temporary directories.

Also killdir should be called with recurse true, and your indentation
is a bit broken at the bottom of cleanup_other_temp_files. And there's
no point in using a longint for age because days_since_datestr returns
an integer.

On 16 July 2013 10:55,  <[email protected]> wrote:
> james
> 2013-07-15 15:55:44 -0700 (Mon, 15 Jul 2013)
> 324
> Add cleanup_other_temp_files() to remove orphaned tmpdir directories left 
> behind when game crashes.
> Does not actually delete anything. Currently just produces debuginfo messages 
> about what it is doing
> Will enable actual deletions once a second pair of eyes have read the code 
> and made sure I didn't
> make any stupid mistakes
> ---
> U   wip/game.bas
> U   wip/game.bi
> _______________________________________________
> Ohrrpgce mailing list
> [email protected]
> http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org
_______________________________________________
Ohrrpgce mailing list
[email protected]
http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org

Reply via email to