Dylan Paul Thurston writes:
> On Wed, Jun 21, 2000 at 07:18:20PM -0700, Dave Peticolas wrote:
> > Autosaving: every autosave_period() time units {
> >               if (database_has_changed()) {
> >                 save_database_to_file("<original name>.autosave");
> >                 if (error)
> >                   report_error_to_gui();
> >               }
> >             }
> 
> As for explicit saves, the autosave should be done to a temporary
> file, then moved to the original spot.  (Or is this too nitpicky?)

Not too nitpicky at all, thanks.


> Probably the temporary files should be in /tmp or /usr/tmp and contain
> the process number.

If we put them in /tmp, then we really need to use something like
mkstemp(char *template) to get a unique name. But I'm not sure we
should put them there. First, if there is an error moving them, it's
easier to find them if we use the same directory (after all, they
should still have good data). Also, I was hoping to use the 'rename'
system call to make things simple (and usually atomic), but rename
doesn't work across different filesystems.

thanks,
dave

--
Gnucash Developer's List
To unsubscribe send empty email to: [EMAIL PROTECTED]


Reply via email to