This just sorta popped into my head:
Suppose I write my own word processor. While typing up a document, the program crashes and burns. I'd like the program to load up next time and say "You were working on a document, would you like to continue?" and have it recover the data.

How would you implement a feature like this? I'm thinking you could use a named file mapping. When the second program loads up and asks for the named file mapping, Windows will hook you up with the data. Or is it the file mapping no good after the first instance crashes? What about something more severe like a power outage?

(The word processor is just an example... could be any program where you wouldn't want to lose your data)

--Chorus
Posted on 2002-09-04 20:22:50 by chorus

How would you implement a feature like this? I'm thinking you could use a named file mapping. When the second program loads up and asks for the named file mapping, Windows will hook you up with the data. Or is it the file mapping no good after the first instance crashes? What about something more severe like a power outage?


Wouldn't that be *all* programs? :p anyway, you could open some other file that (in the case of the word processor for example) output all recently executed commands to a file that got flushed to disk every few seconds, so you might end up with something like this (except encoded more effeciently):

(Begin Document)
(Center)My rex(BKSPC)port(CRLF)(CRLF)(LAlign)This is my report that i(BKSPC)I am writing.(Goto:1,4)(INS)new(INS)(GOTO:EoD) It is a very good report.(FORMAT:ITALICS)(FORMAT:BOLD)SO...(FORMAT:NORMAL TEXT) HAHAHA!(SELECT:ALL)(FORMAT:FONT:50px)

etc.
Posted on 2002-09-04 20:43:43 by jademtech