|Pathologically Eclectic Rubbish Lister|
Accessing SQLite databases within ZIP filesby AppleFritter (Vicar)
|on Oct 01, 2017 at 11:22 UTC||Need Help??|
AppleFritter has asked for the wisdom of the Perl Monks concerning the following question:
Dearest life forms lurking in the Monastery!
I'm trying to process resource files produced by a third-party application. These resource files are actually ZIP files containing, among other things:
I'd like to access all this data. I'd also like to do this in the easiest, DWIMiest, most natural manner possible.
The most straightforward way is of course to extract the ZIP file, and then use DBI, JSON::XS and whatever modules are appropriate to handle the binaries (images, sounds, videos etc). But I'd like to avoid this, if possible; I want to be able to point my script at the ZIP file without having to worry about disk space, clean-up, and all that.
There's a variety of modules on CPAN for transparently handling ZIP archives (in fact, IO::Uncompress::Unzip is in core). What I have not found is a way of accessing a database without extracting it to disk first. More precisely, what I'd like to do is either:
I only need to read the DB, BTW, not modify it, so any complications to do with putting modifications back into the ZIP can safely be ignored.
So, my question is: is this possible, using only existing CPAN modules? A cursory search didn't reveal anything useful.