02-04-2018, 11:47 AM | #1 |
Age improves with wine.
Posts: 558
Karma: 95229
Join Date: Nov 2014
Device: Kindle Oasis, Kobo Libra II
|
Disappearing temp files in Windows
Recently, while editing several different books on Windows 10, I've hit "save" and been greeted by an error message tell me that META-INF/container.xml in the temp directory (somewhere in AppData/Local) is not found, and the file is then basically toast. Sometimes it's just the container.xml that's vanished, which I can manually recover (but it involves unzipping what's left of the epub and adding it manually, which is an annoying and long-winded process) but sometimes all the images are gone as well. Presumably there's something that's cleaning the temp directory that wasn't there a few Windows updates ago, or anti-virus updates or something. (Anyone know what it could be?)
Is there a fix for this that anyone can suggest, e.g. specifying a different temp directory? And if I do something like that, will the temp files be deleted when I close the editor or would I have to clean them manually? |
02-04-2018, 04:58 PM | #2 |
....
Posts: 1,547
Karma: 18068960
Join Date: May 2012
Device: ....
|
I cannot remember the exact error messages but I occasionally experience much the same. If I recall correctly a number of people, including myself, experienced this a few years back and then it went away; it has returned for me over the last month or two.
I have not troubled myself finding a fix due to the occasional nature of the issue and because I found a simple work around that works 100% for me. When I cannot do a normal save due to the issue, in Editor I do a File>Save As to hard drive, then delete the copy in Calibre, load the "Save As" copy into Calibre then open that in Editor. It works for me with no loss of any previous edits. |
Advert | |
|
02-04-2018, 05:08 PM | #3 |
null operator (he/him)
Posts: 20,570
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Try giving calibre a dedicated location for its temporary files via the CALIBRE_TEMP_DIR environment variable, see Calibre User Manual - Environment variables
Which version of Win 10. In 1709 there's a new feature, "Controlled Folder Access", that 'stops' programs using some folder operations - like opening them! Its a means of thwarting ransomware attacks. Might be worth checking out if its enabled. I think you have to opt-in to make use of it, and I have NOT heard of it deleting anything. However there are 3rd party tools that attempt to do 'garbage collection' of the Temp directory, wouldn't surprise me if an AV vendor or something similar added such a feature - which you have to opt-out of Ψ² BR |
02-04-2018, 09:40 PM | #4 |
creator of calibre
Posts: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Just specify a different temp dir one that's hopefully not auto-cleaned and you will be fine. In the next release of calibre, I have added code to use the cache dir rather than the temp dir for temp files to avoid this issue with temp file cleaners.
|
02-04-2018, 09:55 PM | #5 | |
....
Posts: 1,547
Karma: 18068960
Join Date: May 2012
Device: ....
|
Quote:
|
|
Advert | |
|
02-05-2018, 03:50 AM | #6 | |
Age improves with wine.
Posts: 558
Karma: 95229
Join Date: Nov 2014
Device: Kindle Oasis, Kobo Libra II
|
Quote:
|
|
02-05-2018, 03:52 AM | #7 | |
Age improves with wine.
Posts: 558
Karma: 95229
Join Date: Nov 2014
Device: Kindle Oasis, Kobo Libra II
|
Quote:
|
|
02-05-2018, 03:53 AM | #8 |
Age improves with wine.
Posts: 558
Karma: 95229
Join Date: Nov 2014
Device: Kindle Oasis, Kobo Libra II
|
I look forward to it eagerly!
|
02-05-2018, 04:20 PM | #9 | |
....
Posts: 1,547
Karma: 18068960
Join Date: May 2012
Device: ....
|
Quote:
Regarding temp folders, the issue I (and I think everyone else) has is all the dross that collects in them that is never automatically cleaned out. I know Kovid's Calibre one will remain super-clean though . |
|
02-05-2018, 09:51 PM | #10 |
creator of calibre
Posts: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Yeah calibre always deletes its temp files on exit, unless it crashes. And with the change to use the cache dir for the editor/viewer I have even added code to have those programs delete any left over temp files from a crash on startup as well.
|
03-02-2018, 07:12 PM | #11 |
"Why is it doing *that*?"
Posts: 322
Karma: 725344
Join Date: Sep 2011
Device: Black Kobo Touch & Glo, responsible for 2 PaperWhites
|
Hello! I have just experienced this for the first time twice in the past two days, editing an epub with Calibre's editor and having it say: "No such file or directory: 'META-INF/container.xml'
Python function terminated unexpectedly C:\Users\JEANNE~1\AppData\Local\Temp\calibre_0ivav e\ozej2q.epub is not a valid EPUB file (could not find opf) (Error Code: 1)" .. when I tried to reopen it. I was simply editing the text and adding some .css to the the stylesheet. The second time I had a problem - today - I only realised there was a problem when I tried to run the spellcheck and it threw up an error. Luckily I had a backup copy on my reader which I was able to copy over and re-edit. The re-edit was fine, no issues even though I did the same things. Yesterday I was able to reconvert the file in Calibre, replacing what had disappeared (*that* may have been my fault as I was using some broad regex search and replace commands that may have caused that issue) I'm running V3.0 on Win10, have since July and these two instances are the first problems I've had. I did notice that after I had this error message my Temp file in Appdata was pretty clean, which makes me think Windows may have dumped temp files? |
03-02-2018, 09:44 PM | #12 | |
null operator (he/him)
Posts: 20,570
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
Most likely an over aggressive 3rd party utility - such as 'AV Scanning', 'Computer Tune-Up', or 'Garbage Collection'. BR |
|
03-02-2018, 10:47 PM | #13 |
creator of calibre
Posts: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Recent releases of calibre no longer use the temp directory for storing these types of files, because this temp file deleting behavior is becoming more widespread. So if you update, you should be fine. Or you can just set the CALIBRE_TEMP_DIR environment variable as described here: https://manual.calibre-ebook.com/cus...ment-variables
|
03-03-2018, 09:14 AM | #14 | |
"Why is it doing *that*?"
Posts: 322
Karma: 725344
Join Date: Sep 2011
Device: Black Kobo Touch & Glo, responsible for 2 PaperWhites
|
Quote:
Thanks. Kovid, I'll update. The program and the editor are great. I've never had an issue before so I assumed I somehow corrupted it in the past 2 days. Thanks again! |
|
03-03-2018, 09:19 AM | #15 |
Book E d i t o r
Posts: 432
Karma: 288184
Join Date: May 2015
Device: Laptop
|
I'm using the latest version (3.18), and it's still using the TEMP directory for temp Calibre files: C:\Users\myusername\AppData\Local\Temp
VirgoGirl - You can manually delete all the files in your TEMP directory periodically, in case anything gets corrupted. It won't hurt anything at all. Last edited by deback; 03-03-2018 at 09:27 AM. |
Tags |
temp folders |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Windows deleting Viewer's temp files? | Steven Karp | Calibre | 5 | 10-28-2017 05:14 PM |
Calibre temp files keep disappearing | lawnparty | Calibre | 9 | 09-04-2015 04:47 AM |
Temp files cleanup | kiwidude | Development | 2 | 03-05-2011 10:56 AM |
Temp files... | BadGandalf | Calibre | 17 | 10-24-2010 11:38 AM |
Temp files | Jeff L | Calibre | 3 | 10-14-2010 05:58 PM |