Reading from an mwk2 file not saved properly

Hi Chris,

Recently the computer I’m running MWorks on crashed mid-way through an experiment. I’m wondering if it’d still be possible to recover the data? (I have two copies of the file for that session — *.mwk2 and *.mwk2-journal). I tried using the MWKFile reader, but that doesn’t work.

Thanks,
Sachi

Hi Sachi,

As long as the “-journal” file is there, the SQLite library should automatically attempt to recover the data file when you first open it. For this to work, the .mwk2 file needs to be writable, so make sure you haven’t made it read-only. Also, there were some pre-release (i.e. nightly) versions of MWorks 0.9 where the MWKFile interface didn’t auto-recover correctly (due to attempting to open the file in read-only mode). However, the official 0.9 release and later versions of MWorks don’t have this issue.

You can also attempt to repair the file by opening it as an SQLite database in Python. For example:

>>> import sqlite3
>>> conn = sqlite3.connect('foo.mwk2')

If the “connect” call runs successfully, the file should be repaired, and you should be able to read it with MWKFile.

Cheers,
Chris

Hi Sachi,

Were you able to recover your data file?

Cheers,
Chris