![]() |
Unable to open file
I've been editing a book and saving regularly when Windows decided to run an update. Of course the computer restarted and when I tried to open my book in Sigil, I got an error cannot load epub: C:\Users... When I showed the details I got the message cannot unzip epub: c:\users...
When I tried to open the book in Calibre's ebook viewer I get error: could not open ebook. not a zip file and the details showed: calibre, version 2.20.0 ERROR: Could not open ebook: Not a ZIP file Traceback (most recent call last): File "site-packages\calibre\gui2\viewer\main.py", line 38, in run File "threading.py", line 763, in run File "site-packages\calibre\ebooks\oeb\iterator\book.py", line 99, in __enter__ File "site-packages\calibre\customize\conversion.py", line 241, in __call__ File "site-packages\calibre\ebooks\conversion\plugins\epub_in put.py", line 197, in convert File "site-packages\calibre\utils\localunzip.py", line 223, in extractall File "site-packages\calibre\utils\localunzip.py", line 210, in _extractall ValueError: Not a ZIP file The Nook app gave me the message: sorry unable to import. I've even tried to restore my system but I still get the same messages. Is there any way to recover the file? Thanks |
Moderator Notice Was posted in Sigil. Moved |
This is an excellent example of why Windows Update was a bad move on Microsoft's part. But I guess you knew that already.
The PC must have restarted with excellent timing, while you were saving. :p There are a variety of services out there that claim to (try to) repair corrupt zipfiles. Try renaming (a copy of) the epub to .zip and using some of them, it might work. ;) Hopefully you had a backup of the ebook. |
1 Attachment(s)
@Toreth - try using right click Restore Previous Versions on the file in question - maybe you'll get lucky.
And reconfigure Windows Update as shown, then you will be in control of when WU downloads, when WU installs, and when WU restarts. Attachment 136025 The default setting assumes that entirety of the planet's population lives in the USA, that they can all afford to leave their computers running 24*7, and that they're all in bed at 03:00 in the morning :D IMO auto-installs of anything are a menace - but most vendors, including MS, do NOT force you to accept being force fed. Although some of the majors in the Valley try mighty hard to do so. BR Moderator Notice I also moved to Devices because its an OS issue - in truth its probably a Sigil issue, if the OP had been using the calibre editor then maybe the file would have been recoverable from a checkpoint - dunno if that's true as I never tried it |
Hmm, interesting point -- checkpoints are saved within an editing session. Although not restored next time you edit, the info should still be accessible in the working directory, which is located in %TEMP% -- on Windows, this isn't (usually) cleared on reboot.
So if someone was using calibre's editor, the book could probably be restored, with work (mostly searching for the right folder), from the unpacked checkpoints directories. Sigil doesn't use checkpoints, although it might have the same unpacked Tempfiles storage, I don't know -- I haven't used it in a while, and I never checked. Either way, the corruption might have affected those files as well -- but not calibre's checkpoints, which wouldn't be written to. |
My appdata\local\temp is trashed on restart, but calibre has a private TEMP via CALIBRE_TEMP_DIR. Wherever possible I give all applications private TEMP areas. Avoids rummaging around in a pile of 'who knows what' when you're looking for something.
Does the editor take checkpoints of its own accord or only when user tells it to? There primary usage seems to be more like 'super undo' rather the checkpoint/restart facilities in TP monitors like CICS, Toledo, Sabre etc. That's where I first came across 'checkpoint' - a long, long time ago. Ideally a substantial 'editor' (ie one in which you're likely to spend a long time) should do protection saves at a user specified interval, and be able to recover from it in the event of a crash, power out, equipment failure or other abrupt termination. BTW - AFAIK WU does a bog-standard restart. If so then Sigil (or the calibre editor) would have got a message from Windows telling it to quit, at which point it could have done a 'protection save', and made a note of that in its control data. And then offered to reload that file next time it was used. BR |
Word processors and the like usually do Restores, neither Sigil nor calibre do. Perhaps implementing such features is non-trivial to the point only teams dare touch it -- calibre and Sigil both have tiny dev teams, Sigil particularly has tended to survive off of one-off contributions.
Calibre checkpoints require manual intervention. |
1 Attachment(s)
Quote:
None of the schemes are perfect, not even Wordperfect's - but they do work most of the time. They've got me out of a few black holes in the event of power fails, video card crashes or my own stupidity. BR |
Hah -- never used Notepad++ all that much. Nice app, but no linux build.
But a text editor has far less to track than a document editor. Anyway -- it is still the kind of thing that someone needs to focus on, which is less likely when only one or two people work on said program, have many things to focus on, and no one ever complained loudly enough. I am therefore not terribly surprised by any software that doesn't have this (excepting business-class and its competition, or software manned by said ranks :D). Would be a nice feature, of course. |
Quote:
|
Quote:
Under normal circumstances it appears to have a copy of the book under edit as it was when opened, that gets deleted when Sigil closes. Question is, when Sigil gets a close message because Windows wants to do a restart does it leave it there. Maybe it does because if I kill Sigil the session folder is still there :) |
And same with calibre -- it doesn't always get a chance to clean up properly. I noticed that a number of times with Windows, the temp folder would slowly fill with calibre data folders even when closing normally.
On linux it seems to be promptly deleted. Maybe something to do with file locking. |
A power outage or crash or forced reboot *cannot* corrupt a file being edited in the calibre editor. The calibre editor makes *atomic* updates to the file. That mean that it saves a copy of the edited file and then atomically renames it to the original, only if the save operation successfully completed. I have no idea about Sigil.
@BR: Having autosaves at an interval is a poor man's alternative to using atomic file operations for updating files. It is typically found in older editing software or editing software where the file format being edited is suitable for in-place updates. |
Kovid -- how does atomic updating help one recover one's work if no save was attempted?
|
I was only addressing autosaves as a mechanism for protection against corruption caused by crashes, which is what appears to have happened to the OP.
|
| All times are GMT -4. The time now is 09:23 PM. |
Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.