[Coco] suggestion for Ultimuse

KnudsenMJ at aol.com KnudsenMJ at aol.com
Tue Nov 18 20:56:21 EST 2003


In a message dated 11/18/03 2:20:41 PM Eastern Standard Time, 
dmacias666 at LABridge.com writes:

> Why not auto save like Word.  Have a separate auto save file and leave the
>  main file untouched.  Exiting normally should delete the auto save file.  
If
>  the program crashes (never!) then the auto save file would be intact.

Well, that's a good idea.  Don't make up a temp file name based on the file 
being edited, but just use one fixed name, like "autosave.ume".  Or maybe 
"autoNNN.ume", where NNN is the ProcID number, so you can have more than one copy 
of UME running in different windows on the same directory.

Then on exit, always do an F$Unlink  (delete) on the auto file.
Very clean, and a great idea that overcomes most of the objections!

Now to figure how to implement it.  My first thought is to Fork off another 
process with two parameters -- the time itnerval in seconds, and my own ProcID. 
 Every N seconds, this process sends me a Signal of a pre-arranged type.  My 
signal-handling routine (already exists, called break()) would field that and 
call the file-save routine.

BTW, is it OS9 or Linux where you aren't suppsoed to do I/O (at least not the 
FILE* buffered I/O) while inside the trap interrupt handler?

I could also used a Named Pipe to get the "save now" command from the timer 
process, since in OS9 (unlike *nix) you can pre-test the pipe and read it 
without blocking.

Say, I wonder if UME on the MM/1 has ever crashed on anyone.  Some years ago 
I found and fixed a couple of uninitialized pointers that sometimes crashed 
from the KeyPad editor mode.  Thanks for your interest -- Mike K.



More information about the Coco mailing list