[Padre-dev] Autosave plans

Gabor Szabo szabgab at gmail.com
Thu Nov 6 11:05:35 PST 2008

package Padre::Autosave;
use strict;
use warnings;

=head1 NAME

Padre::Autosave - autosave and recovery mechanizm for Padre

=head1 The autosave plan

I'd like to provide autosave with some history and recovery service.

This plan is not Padre specific.

An sqlite database will be used for this but theoretically
any database could be used. Event simple filesystem.

Basically we provide a versioned filesystem here with
autocleanup and metadata.

Besides the content of the file we need to save some meta data:
- path to the file will be the unique identifyer
- timestamp
- type of save (initial, autosave, usersave, external)

When opening a file for the first time it is saved in the database.(initial)
Every N seconds files that are not yet saved are autosaved in the
database. (autosave)
Evey time a file is saved it is also saved to the database. (usersave)
Before reloading a file we autosave it. (autosave)
Every time we notice that a file was changed on the disk if the user decides
to overwrite it we also save the (external) changed file.

Before autosaving a file we make sure it has not changed since the
last autosave.

In order to make sure the database does not get too big we setup
a cleaning mechanizm that is executed once in a while.
There might be several options but for now:
1) Every entry older than N days will be deleted.

Based on the database we'll be able to provide the user recovery in
case of crash or accidental overwrite.

What do you think?


More information about the Padre-dev mailing list