Zip file compression metadata curiosity

Enhance Your Overall Game-Play.
Mod-Database, Calculators, Cheatsheets, Multiplayer, Scripts, Libs and Other Useful Stuff.
Post Reply
User avatar
moon69
Fast Inserter
Fast Inserter
Posts: 137
Joined: Sun Sep 18, 2016 6:53 pm
Contact:

Zip file compression metadata curiosity

Post by moon69 »

Is there any info around on the implementation of Factorio's zip file handling?

I've started using the 'autosave-compression-level=none' option in config.ini, but getting some unexpected values in the file headers of the resulting zip file (well possibly unexpected because I don't fully understand the intricacies of the zip spec!)...

In the usual compressed Factorio save zip, the files are marked as "Deflate" compression method, with level of "Fastest".
In the 'autosave-compression-level=none' zip, the files are also marked as "Deflate" compression method, but with level of "Normal"... and the resulting packed size of the files are all slightly larger than the original uncompressed file size.

What I expected to see was the "Stored" compression method, and the packed size of the files identical to original.

Background: I've an external tool to manage the saves folder - timestamping zip filenames, archiving off to HDD etc. Now I want it to zip the older uncompressed saves in a Factorio compatible format.

Cheers.

User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2637
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: Zip file compression metadata curiosity

Post by Optera »

Your question made me curious, so i tried repacking safes with 7zip.
deflate works with any compression level
deflate64 reports corrupted file

Jap2.0
Smart Inserter
Smart Inserter
Posts: 2213
Joined: Tue Jun 20, 2017 12:02 am
Contact:

Re: Zip file compression metadata curiosity

Post by Jap2.0 »

Zlib 1.1.4 per this, apparently (as of a few months back) - not sure if that helps.
There are 10 types of people: those who get this joke and those who don't.

User avatar
moon69
Fast Inserter
Fast Inserter
Posts: 137
Joined: Sun Sep 18, 2016 6:53 pm
Contact:

Re: Zip file compression metadata curiosity

Post by moon69 »

Interesting thanks.

Edit:
Rseding91 wrote:
Fri May 01, 2020 2:31 am
I fixed it for the next release so it will mark them as stored when no-compression is used.

Post Reply

Return to “Tools”

Who is online

Users browsing this forum: No registered users