http://gilgamesh.hamsterrepublic.com/cgi-bin/bugzilla/show_bug.cgi?id=280


[EMAIL PROTECTED] changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|feature request             |minor
          Component|GAME.EXE (General)          |General (game+custom)
         OS/Version|Linux                       |All
           Priority|P4                          |P3
            Summary|Linux: Need scheme to clean |Need scheme to clean up temp
                   |up temp files               |files




------- Comment #3 from [EMAIL PROTECTED]  2007-08-23 23:08 -------
This is now not just a Linux issue, it affects Windows too. game.exe on windows
stores temp files in C:\Documents And Settings\Username\Local
Settings\Temp\ohrrpgceDATE.RANDOM.tmp\

Like Linux, the temp folder is cleaned up if game exits normally, but if game
crashes, the temp file gets left behind.

(In reply to comment #2)
> The only way I can think of to work around this problem is to have game write
> its PID into the temporary folder.
> 
> Subsequent instances of game need to check each temp folder on start up,
> looking up the PID of each to see if they are still running, and clean up the
> temp files if not.

Thinking again about my earlier comment, writing PID to a file will not work
either. There is no guarantee that a given PID will not later be assigned to
another process, and checking the true identity of a process is way too
complicated for this task.

The idea I favor now is that immediately after creating tmpdir$, game will open
a lock file for write access, like "lockfile.tmp" and it will not close that
lockfile until right before it cleans up the temp folder.

On exit, after cleaning up its own temp dir, game can search all the other temp
dirs also, checking each one to see if it can get write access to lockfile.tmp

if it can, it can assume that the temp dir is orphaned, and delete it. if it
fails to get write access, it assumes that another instance of game is
currently using the dir, and it ignores it.


-- 
Configure bugmail: 
http://gilgamesh.hamsterrepublic.com/cgi-bin/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

_______________________________________________
Ohrrpgce mailing list
[email protected]
http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org

Reply via email to