3 May 2006 (Wed)

01:20:37 # Life Wondering how to remove tempfiles. Since I'm so much annoyed by the current behaviour of cowdancer, I don't want to have .ilist file in the current directory. Instead I want to put it somewhere under /tmp. Current model of cowdancer execution is that it creates a file called .ilist in the current directory, and each session of application under cowdancer control will mmap that file. It might be better if I just dump something in /dev/shm, or /tmp which might even be memory-backed to alleviate the need for disk access. cow-shell execs the child session, and thus it's no longer available to remove the .ilist file when it's time to free it. .ilist file isn't that big, so leaving it in /tmp for later automatic removal by other means sounds feasible; I'm not too sure. SysV IPC shm routines with Linux extentions look a bit attractive, although I really dislike the arcane interface. Gives me the same sense of fear as when I look at X Toolkit programming. I wonder what's the current recommended way to go forward.

Pros Cons
A known filename in current directory Same file for multiple invocation from the same directory Hard to automatically detect the files no longer used, to mark them for deletion.
/dev/shm or /tmp Eventually automatically deleted by tmpreaper et al. Could be memory-backed. Multiple files can be generated for same directory under different names.
shmget/shmat Could be deleted when all attaching processes die when shm segment is marked for deletion. (Linux extention) Uses an arbitrary number as shm ID. Arcane interface with Linux-specific extensions, something to be left for good along with the fond memories of the 20th century?
Junichi Uekawa

$Id: dancer-diary.el,v 1.90 2006/01/31 11:16:16 dancer Exp $