5
votes

I have a well-honed Control-S reflex (i.e. I obsessively save my work), but when Mathematica crashes with a file open the saved changes are not recovered when I restart Mathematica and open the file. It reverts back to the file's state when I first opened it before making (and saving) any changes.

How can I actually save my work, without needing to save, close and re-open a notebook with the same obsessive regularity that I "save"?

I'm running Mathematica 8.0 on a Windows XP x64 machine.

Edit: Just to clarify, I'm not so worried about the crashing. I'm concerned about saving not actually saving.

3
If you quit Mathematica normally, are your changes successfully saved? - Brett Champion
Yes, if I close the file (and/or Mathematica) normally then the changes are saved - Eli Lansey
Can you evaluate Options[EvaluationNotebook[]] from within the notebook and post the result? Or post the notebook somewhere? - Brett Champion
@BrettChampion {FrontEndVersion -> "8.0 for Microsoft Windows (64-bit) (November 7, 2010)", StyleDefinitions -> "Default.nb", WindowMargins -> {{Automatic, 42}, {39, Automatic}}, WindowSize -> {1370, 794}} - Eli Lansey
Well those options are nice and boring. :-) Is the notebook especially large, or live in some 'special' location on your hard drive? - Brett Champion

3 Answers

2
votes

This may be a case of Windows not flushing its disk cache to disk. You might want to try the Sysinternals' tool Sync. "Use it whenever you want to know that modified file data is safely stored on your hard drives."

You can have Mathematica call Sync using Run and automate the process in the background using scheduled tasks like in this answer.

1
votes

Edit->Preferences->Advanced; Open Option Inspector.

Lookup: NotebookAutosave

This will save every time you press shift+enter. It can be a disk burden for large files.

1
votes

I have a similar problem with Mathematica 10, my temporary solution is to save to a filename with a name ending with "a" - "filenamea.nb", and switch and save to a name ending with b "filenameb.nb".

I've been using Dropbox to restore older version until I discovered that in this version Mathematica doesn't flush the files (at all it seems unless you close the file). This is especially a problem when it crashes.

It is possible that some of this could be tweaked in the advanced options, but I couldn't figure out how yet, I posted a question with Wolfram. To be continued...