save(filename, "undefinedVariable") creates a useless empty file
Reported by Samuel GOUGEON (@sgougeon)
HOW TO REPRODUCE THE BUG:
-------------------------
save("atomsLoad_s.bin","atomsLoad") // should work. Does not: corrupted file
save("atomsLoad_f.bin",atomsLoad) // former syntax => warning, but works.
fileinfo(["atomsLoad_s.bin"; "atomsLoad_f.bin"]) // both files have different size (1st column)
BUG DESCRIPTION:
----------------
-->save("atomsLoad_s.bin","atomsLoad")
-->save("atomsLoad_f.bin",atomsLoad)
Warning: Scilab 6 will not support the file format used.
Warning: Please quote the variable declaration. Example, save('myData.sod',a) becomes save('myData.sod','a').
Warning: See help('save') for the rational.
-->fileinfo(["atomsLoad_s.bin"; "atomsLoad_f.bin"]) // both files have different size (1st column)
ans =
49904. 33206. 0. 0. 2. 1.376D+09 1.376D+09 1.376D+09 2. 0. 0. 0. 1.
55580. 33206. 0. 0. 2. 1.376D+09 1.376D+09 1.376D+09 2. 0. 0. 0. 1.
When loading the new SOD file (the smallest one), using it does not work.
Loading and using the bin saved from the macro itself (not its name) works.
This is not specific to this macro (that holds a single definition, with no
inner local function), despite that simpler one may be correctly saved with
the new SOD syntax.
ERROR LOG:
----------
none. wrong recording of data.
OTHER INFORMATION:
------------------
This case has been lastly met when patching the bug 12791, as well as sooner
with other macros after the new save syntax has been released.
The bug occurs as well when other variables are saved together with macro(s)
in a .sod file.