Reading from an mwk2 file not saved properly

Sachi Sanghavi's Avatar

Sachi Sanghavi

28 Feb, 2021 05:06 PM

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

  1. Support Staff 1 Posted by Christopher Sta... on 28 Feb, 2021 05:20 PM

    Christopher Stawarz's Avatar

    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

  2. Support Staff 2 Posted by Christopher Sta... on 10 Mar, 2021 03:01 PM

    Christopher Stawarz's Avatar

    Hi Sachi,

    Were you able to recover your data file?

    Cheers,
    Chris

  3. Christopher Stawarz closed this discussion on 25 May, 2021 04:25 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

17 May, 2022 02:12 PM
16 May, 2022 03:12 PM
04 May, 2022 06:02 PM
03 May, 2022 01:30 PM
02 May, 2022 10:47 PM