sqlar.c, as of check-in [4a0ed63dae] at 2017-12-02 19:15:43 on branch trunk, in its write_file() function, does nothing with the mtime argument. Upon restoration out of an archive, all files have the same, nearly useless timestamp.
Adding these lines in the right places fixes this deficiency:
#include <utime.h> // near sqlar.c top
...
struct utimbuf tb = { mtime, mtime }; // near write_file top
...
rc = utime(zFilename, &tb); // at write_file bottom
if( rc ) errorMsg("cannot set timestamps: %s\n", zFilename);
I'm sure that including mtime in the schema was well motivated, so I cite that in lieu of an argument for actually preserving the corresponding file attribute.
|