Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 03-16-2015, 12:24 AM   #16
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
True, but you did in part respond to BR -- whose additional concern was for people who don't habitually save, and might lose their work regardless.

It is a nice idea -- although I would understand if you don't feel the urge to implement it.
eschwartz is offline   Reply With Quote
Old 03-16-2015, 12:42 AM   #17
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 44,034
Karma: 22669822
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Implementing autosaves is actually trivial, about 10 lines of code, since in the calibre editor, saving occurs as an async background process in any case. Here I mean an autosave as a normal save, just automated.

However, IMO, autosaves are a terrible idea. There is no guarantee that the state of the book is valid when an autosave occurs, for example, you could in the middle of typing a tag making the html invalid, or a multi-step search and replace or whatever.

And note that BR actually said:

Quote:
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.
Which is what I was directly addressing as being totally unneccessary when you have atomic save operations.
kovidgoyal is offline   Reply With Quote
Advert
Old 03-16-2015, 12:59 AM   #18
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
We are talking at cross-purposes I think.

Consider the feature of your average word processor -- if it closes unexpectedly, it leaves the file alone but offers (Document Recovery pane) to restore you to your work-in-progress as of the last auto-pseudo-save (which doesn't write to the original, but to backup data). The user has the choice to reject the offered Restore, but if one isn't as careful at saving as they should be, it could save them quite a bit of almost-lost progress.
eschwartz is offline   Reply With Quote
Old 03-16-2015, 01:27 AM   #19
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 44,034
Karma: 22669822
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Indeed, I am talking about protection from corruption by a crash during a save operation.

You are talking about protection from losing work done since the last save. Two totally different things, that have no connection.

I suggest we stop confusing the issue in this thread, which, if I understand the OP correctly is about corruption of an ebook by a crash/forced shutdown during a save operation.

Last edited by kovidgoyal; 03-16-2015 at 01:31 AM.
kovidgoyal is offline   Reply With Quote
Old 03-16-2015, 01:30 AM   #20
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 44,034
Karma: 22669822
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
As for the OP's question, which was actually how to recover a corrupted epub file.

@Toreth: An EPUB file is really just a ZIP file.

The error indicates that the underlying ZIP file itself was corrupted. calibre tries hard to recover from common forms of zip file corruption, so if calibre cannot open it, you are probably out of luck.

One thing you can do is try to open it in WinZip (which has even more workarounds for zip file corruption). If it can repair the ZIP file you should then be able to open it in other programs.
kovidgoyal is offline   Reply With Quote
Advert
Old 03-16-2015, 01:38 AM   #21
AnotherCat
....
AnotherCat ought to be getting tired of karma fortunes by now.AnotherCat ought to be getting tired of karma fortunes by now.AnotherCat ought to be getting tired of karma fortunes by now.AnotherCat ought to be getting tired of karma fortunes by now.AnotherCat ought to be getting tired of karma fortunes by now.AnotherCat ought to be getting tired of karma fortunes by now.AnotherCat ought to be getting tired of karma fortunes by now.AnotherCat ought to be getting tired of karma fortunes by now.AnotherCat ought to be getting tired of karma fortunes by now.AnotherCat ought to be getting tired of karma fortunes by now.AnotherCat ought to be getting tired of karma fortunes by now.
 
Posts: 1,547
Karma: 18068960
Join Date: May 2012
Device: ....
I'm not sure if the problem was a crash or a forced reboot by Windows Update (the latter would surprise me), but if the latter then in addition to BR's:

Quote:
Originally Posted by BetterRed View Post
@..And reconfigure Windows Update as shown, then you will be in control of when WU downloads, when WU installs, and when WU restarts...
If one really wants auto updates then whether one gets an auto restart or not following an auto update can be easily configured in the Local Group Policy Editor and has been able to be so in all Windows versions since at least XP.

It's in Local Computer Policy>Windows Components>Windows Updates and the setting to edit is "No auto-restart with logged on users for scheduled automatic updates installations". (To get to Local Group Policy - Run gpedit.msc or for Win 8 is quicker to just type gpedit.msc on the Start Page.)

If "Enabled" the computer waits for the user to restart the computer.
AnotherCat is offline   Reply With Quote
Old 03-16-2015, 02:52 AM   #22
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,702
Karma: 26966376
Join Date: Mar 2012
Location: Sydney Australia
Device: none
There's no reason why an 'autosave' cannot be done atomically. The autosave features I know of don't write over the real file they write it to a user specified location, the default of which is typically something like %appdata%\somewhere or %documents%\somewhere. Where I can I change it - word, notepad, excel and calibre.

An Autosave will not get you back to the very last keystroke, at best it will get you back to the previously completed autosave - unless of course your autosave device failed. Even Sabre's checkpoint/restart was never 100%, nor was Tandem's Non Stop.

I know of 2 prize winning published authors who turned off autosave in Word (they were told by some geek that it made Windows 'really' slow). They both also lost half or more days work due to power fails - when your on a roll you don't bother with ctrl/s.

BTW when I write something lengthy in Word I don't write it as a monolithic document. I use Word's Master Document feature to break it up into smaller files (parts, chapters), Master Documents first saw the light of day in Word '97. Sound familiar ?

@AnotherCat - good point, pssst - I filched a Registry patch from Windows 7 Forum that puts gpedit in the control panel.

BR

Sabre is an airline reservations systems - one of first 24*7 transaction processing systems (initially developed in the 1950/60s). Is still used by many (most ?) international airlines ==>> Sabre (computer system)

Last edited by BetterRed; 03-16-2015 at 03:24 AM. Reason: Ack AnotherCat
BetterRed is offline   Reply With Quote
Old 03-16-2015, 03:08 AM   #23
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 44,034
Karma: 22669822
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
What has autosaves being done atomically or not have to do with anything? You complained that Sigil and the calibre editor do not allow you to recover a document corrupted by a crash. I explained to you that the calibre editor cannot ever corrupt a document due to a crash.

Once again, there are two totally separate things that you seem to be conflating

1) Protection from file corruption caused by a crash/forced shutdown during a save operation

2) The ability to recover (some) unsaved work

The two have nothing to do with each other.

(1) is irrelevant to the calibre editor, since it can never happen.

(2) is irrelevant to the topic of this thread, since it is not what the OP is asking about.

And while on the subject of irrelevancy, I dont see why this thread belongs in a calibre forum at all. The EPUB in question was corrupted by Sigil and a better place to ask about techniques for recovering corrupted EPUB files would be the forum dedicated to EPUB.
kovidgoyal is offline   Reply With Quote
Old 03-16-2015, 03:40 AM   #24
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,702
Karma: 26966376
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Totally agree Kovid,

However IMO your earlier post implied that an autosave written for the purpose of recoverability couldn't be done atomically. But I don't want to get into a semantic argument about it.

I was minded to move the thread back to Sigil, following post 10 from Ripplinger. There's a good chance the EPUB is in %LOCALAPPDATA%\Temp\sigil\scratchpad


Moved back to Sigil - OP's problem has nothing to do with Calibre
BetterRed is offline   Reply With Quote
Old 03-16-2015, 10:36 AM   #25
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,763
Karma: 5446592
Join Date: Nov 2009
Device: many
Sigil saves to a temp epub first and then physically overwrites the original epub to save extended file attributes on the Mac. Only once the copy is successfully complete does it delete the temp epub in the temp folder.

So since the file copy never completed, there should be a temp version of the epub as a zip file someplace in the temp directory. Unless the reboot caused the temp directory to be wiped. On Mac is typically is not wiped until needed. I am not sure how that works on Windows. So he should find the entire epub as a zip in the Sigil temporary directory on his OS.
KevinH is offline   Reply With Quote
Old 03-16-2015, 06:36 PM   #26
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,702
Karma: 26966376
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by KevinH View Post
Sigil saves to a temp epub first and then physically overwrites the original epub to save extended file attributes on the Mac. Only once the copy is successfully complete does it delete the temp epub in the temp folder.

So since the file copy never completed, there should be a temp version of the epub as a zip file someplace in the temp directory. Unless the reboot caused the temp directory to be wiped. On Mac is typically is not wiped until needed. I am not sure how that works on Windows. So he should find the entire epub as a zip in the Sigil temporary directory on his OS.
@KevinH - one has to go out of ones way to flush the Windows temporary folder automatically by scheduling a 3rd party app to run at shutdown, a batch file to run at startup... or something similar. It's not a normal practice.

I can confirm that if Sigil is not closed gracefully in Windows then the copy of the file under edit (as originally read) remains in ...\Temp\sigil\scratchpad - it's unpacked so it would need to be zipped with epub extension.

If I restart Windows and Sigil has an unsaved file, I get Sigil's normal "File hasn't been saved - Save, Discard, Cancel" popup message, and if I ignore that I get the following after ~10 seconds

Click image for larger version

Name:	Screenshot - 2015-03-17 , 09_02_50.jpg
Views:	165
Size:	36.2 KB
ID:	136083

I think that waits forever for a response.

But I'm not sure if the above is true if Windows Update initiates the Restart automatically, the way I have it configured that can't happen and I'm not minded to change it for testing.

So I suggest there's nothing to do... unless if'n you wanted to implement some sort of recovery scheme via automatic periodic saves

BR
BetterRed is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sigil unable to open a file Andjety Sigil 39 03-20-2017 11:08 PM
unable to open database file mihal.v Calibre 3 08-16-2014 09:44 AM
Unable to open database file wladdy Library Management 6 08-28-2012 05:04 AM
Unable to open database file JulieR Calibre 2 04-24-2009 04:40 AM
Unable to open file that is 8MB timyap Sony Reader 12 05-09-2008 09:51 AM


All times are GMT -4. The time now is 09:11 PM.


MobileRead.com is a privately owned, operated and funded community.