A save(File, "-append", "myVar") error deletes the existing file and so all existing data!
Reported by Samuel GOUGEON (@sgougeon)
BUG DESCRIPTION:
----------------
When an error in met in save() in "-append" mode, the existing file is deleted and all existing stored data are lost!
--> a = 1;
--> iL = 1:$; // can't be saved => will yield an error
--> File = TMPDIR+"\bug_15721.sod";
--> save(File, "a") // OK
--> save(File, "-append", "iL") // => error: OK
save: Unable to export variable 'iL' in file 'TMPDIR\bug_15721.sod'.
--> isfile(File)
ans =
F <<<<<<< !!
In "-append" mode, save() should only skip unsavable contents, and keep all existing data!
In usual mode, save() should only skip unsavable contents, and save all savable data.
ERROR LOG:
----------
HOW TO REPRODUCE THE BUG:
-------------------------
a = 1;
iL = 1:$; // can't be saved => will yield an error
File = TMPDIR+"\bug_15721.sod";
save(File, "a") // OK
save(File, "-append", "iL") // => error: OK
isfile(File)