On Wed, Jul 17, 2013 at 04:39:25AM +1200, Ralph Versteegen wrote:
> 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?

The parent directory of the tmpdir is chosen differently on different 
OSes, but there have only been two formats for the name of the tmpdir 
itself, and that is YYYYMMDDhhmmss.RANDOM.tmp and 
ohrrpgceYYYYMMDDhhmmss.RANDOM.tmp

> 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.

Yes, for example, I noticed one totally empty tmpdir on my system which 
it ignores because there is no playing.tmp in it.

My reason for not deleting dirs unless playing.tmp is present is because 
that on windows, *.*.tmp could possibly match tmpdirs that belong to 
other programs.

> 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.

Yep, that is why I did it before. I figure we can fix that easily after 
further findfiles cleanup

> 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.

Oops! That would indeed explain a lot :P

> Also killdir should be called with recurse true,

It is indeed (or is in the commented-out code anyway)

> 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.

Oops, silly me. I though I changed that back to integer before I checked 
in. I guess I didn't.

Thanks!

---
James

> 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
> 
_______________________________________________
Ohrrpgce mailing list
[email protected]
http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org

Reply via email to