Edit E-Book will not save after editing if original file is not in its directory.

Bug #1513849 reported by Nosphky on 2015-11-06
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

Using UbuntuStudio 1404 on 64 bit machine with Calibre 2.41

During an editing session on an epub file, the original was inadvertently removed from its directory. Edit E-Book failed to save with error reporting that the file or directory did not exist.

Sure enough, when I checked, the directory structure was still ok but the file had vanished.

(Don't ask ... in 30 odd years, I have occasionally regretted deleting a file but never yet deleted one without knowing. For me it's a mystery but no reason to believe Calibre was involved in its disappearance.)

To avoid losing the editing I had done, I tried to do a 'file/save copy'. This would not not work either using original filename or a new filename - same error.

My work-around to avoid losing data was to stuff a backup copy of the file (with same name) into the directory. And then both save and savecopy worked as it should and no data was lost.

It happened with Calibre 2.41 but I can repeat this scenario as often as I like with Calibre 2.43.

Steps to repeat :

- open file in Edit E-Book
- remove file from its directory
- make some edits and try to save
- save fails with error about : " No such file or directory: /path/to/file/filename.epub"
- replace file into its correct directory
- save works ok

My expected behavior would be that if Calibre finds the original file has disappeared for whatever reason, it rewrites the file or at least permits a 'save copy' to be made.

calibre uses an "atomic update" technique to ensure the file it is
editing to is never corrupted in the event of crashes/power failure in
the middle of saving. Part of that technique requires the original file
to exist. I suppose I could look into trying to handle the case of the
original file going missing during an editing session, but, I dont know
if that will be feasible or not, if not, trying to handle the case of
the original file being deleted in the middle of an editing session is
not worth the tradeoff.

Fixed in branch master. The fix will be in the next release. calibre is usually released every Friday.

 status fixreleased

Changed in calibre:
status: New → Fix Released
Nosphky (philip-jackson) wrote :

Wow, that's speedy.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers