mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Rename old 'xml' file as 'bak' file when saving
If you use the standard naming convention and end your subsurface filename in ".xml", we will now save away any previous xml file as a "bak" file before writing a new one. This can be useful for: - recovering from mistakes that deleted old dives - seeing what changed (ie you can do things like "diff -u xyz.bak xyz.xml") after doing some operation and saving the result. However, this does only a single level of backups - if you save twice, you will obviously have lost the original. I'd strongly encourage some external backup system in addition to this very simplistic backup. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
16e03ff86e
commit
90dddeb4cc
5 changed files with 61 additions and 0 deletions
1
dive.h
1
dive.h
|
|
@ -656,6 +656,7 @@ extern void save_dives_logic(const char *filename, bool select_only);
|
|||
extern void save_dive(FILE *f, struct dive *dive);
|
||||
extern void export_dives_uddf(const char *filename, const bool selected);
|
||||
|
||||
extern int subsurface_rename(const char *path, const char *newpath);
|
||||
extern int subsurface_open(const char *path, int oflags, mode_t mode);
|
||||
extern FILE *subsurface_fopen(const char *path, const char *mode);
|
||||
extern void *subsurface_opendir(const char *path);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue