Menu

#129 Retain temporary directories within same session

Git
open
nobody
None
5
2023-08-30
2023-08-30
FeRD
No

Imagine I have a directory containing several comics archives, particularly large-size ones. For instance,

$ cd imaginary_dir; ls -1
some_150pg_anthology.cbr
this_other_600pg_omnibus.pdf
ultimate_something_collection_950pgs.cbz

Right now, if I open this_other_600pg_omnibus.pdf, MComix will duly extract its entire contents to /tmp/mcomix.linenoise1/ and then display them.

If I have next/previous archive mode enabled, and I hit PgUp or scroll backwards from the first page of that comic, MComix will switch to some_150pg_anthology.cbr and extract that archive to /tmp/mcomix.linenoise2/ so that it can display the last two pages (assuming I'm in dual-page mode).

What happens when I hit PgDn from there?

Well, MComix doesn't switch back to /tmp/mcomix.linenoise1/. Instead, it re-extracts this_other_600pg_omnibus.pdf to /tmp/mcomix.linenoise3/. Which, if that file is on a remote server, can take a hellish amount of time... time that we already spent extracting that file the first time.

It might be tricky to manage, in terms of disk space, efficiency, not leaving turds around on exit, etc.... but I think it should be possible for MComix to retain at least the extracted volumes on either side of the current one, when they've already been extracted, just incase next/previous archive mode causes them to be revisited.

(The irony here, too — as I only just noticed — is that MComix actually doesn't delete /tmp/mcomix.linenoise1/ when it switches to the second comic. It only deletes that dir immediately before creating /mcomix.linenoise3/. So the files are even ALREADY WAITING THERE for it to reuse. It just has to be taught how.)

Discussion


Log in to post a comment.

MongoDB Logo MongoDB