IIR_
Posts: 2
Joined: Wed Dec 07, 2022 12:38 pm

[Code:Python] A utility to optimally recompress collections (etc)

Hello all, I've been working on optimizing disk usage with ROMs (and other things) and haven't found any viable (re)compressors out there that do an optimal job.

Thus I've written a Python-based command-line repacker that takes a source directory - with configurable extensions - and recompresses or copies it to another location:

https://github.com/noisysoil/file-repacker

For example, you can tell it to compress only .zip and .col extensions - the rest are copied. Unlike other tools, It avoids extracting archives to disk - it's all done in-memory.
You can also specify how many threads it uses to work through those big directories as you see fit.

With some test ROM collections the savings can be huge using the code's default 7zip LZMA2 setting - the most-supported format across systems that I've tested.

It's written in Python and it'll also warn of any weird file/archive issues (e.g. broken CRC's in archives) and will default to copy these instead.

Feel free to notify me if you find any issues with recompressed collections; I've extensively tested as many scenarios as I can, with 1:1 success, but there's a large ecosystem out there :D

Enjoy!

Return to “MAME Discussion”