Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development
"Auto restore" feature for autosave plug-in?
Alpha:
Some programs do crash recovery/auto restore in the following method:
* Periodically save a copy of modified files (plus meta-data pointing to the location of the actual file) to a directory in the application data folder
* When a file/project is saved (in Code::Blocks), delete the corresponding shadow copy (if it exists)
* When a file/project is closed (in Code::Blocks), delete the corresponding shadow copy (if it exists)
* On startup, check the recovery directory in the application data folder, if any files exist in it, prompt the user (for each file) to:
* restore - shadow copy is written over the actual file, then shadow copy is deleted
* discard - shadow copy is deleted
* remind me later - nothing is done (the shadow copy still exists, so it will prompt on next startup)
This is different in that it can be done silently/invisibly, without the user ever seeing the extra files. Maybe this would be an advantage, or maybe not; but it is another idea you could consider.
oBFusCATed:
Alpha: Why bother doing reimplementing the wheel, when there is git :) (which does the same) or any backup solution native to your OS?
Alpha:
I guess I forgot to mention (but I thought it was assumed?) this is for crash protection: the shadow copies would only exist on startup if Code::Blocks unexpectedly quit/crashed on the last run.
Maybe "shadow copy" was not the best choice of words. It is not a backup of a file, but a snapshot of unsaved data. So I do not believe this is a reimplementation of the wheel (as Code::Blocks does not currently have an "auto-restore from crash recovery files wheel" :)), just a different design option for the above discussed auto-restore feature.
Navigation
[0] Message Index
[*] Previous page
Go to full version