tsolomko / SWCompression

A Swift framework for working with compression, archives and containers.
MIT License
237 stars 41 forks source link

Support splitting zips into multiple files #50

Open ehemmete opened 8 months ago

ehemmete commented 8 months ago

I am working on a tool for my team to prep files for upload to cloud services as an archive. One of the steps is to turn bundle file types (.aplibrary, .fcpbundle, etc) into a single file for upload so the bundle flag doesn't get broken. However, some of these bundles are huge and even compressed are too large to upload.

I would like to be able to specify a max file size and that the tool create as many files as needed to archive the original in chunks up to max size.

Currently I am trying to use Process to run the built in /usr/bin/zip which can work, but is annoying and not very swifty. i.e. /usr/bin/zip -r -s 150g "(fileURL.path).zip", fileURL.lastPathComponent

It looks like the built in zip in macOS 13 & 14 is Info-ZIP https://infozip.sourceforge.net/ The ouput is a set of files like: filename.z01 filename.z02 filename.z03 filename.zip

The Unarchiver (https://theunarchiver.com/) knows how to unzip these even though the built in Archive Utility doesn't.