Can't extract a file from a multi-part zip archive using command-line tools.
I need to split a video file into <500MB chunks for uploading to a site with size restrictions. Using /usr/bin/zip I appear to be able to successfully create a split zip archive, but when I attempt to confirm the files are usable by recombining and then extracting I don't get a usable file. Here are the steps I'm taking to create the split archive:
- Create zip archive of the video file without applying further compression: /usr/bin/zip -n .mov movie_archive.zip movie_file.mov
- Split the archive into <500MB chunks: /usr/bin/zip movie_archive.zip --out movie_pieces.zip -s 470m
The result is 12 sub-500MB files (movie_pieces.zip, movie_pieces.z01, movie_pieces.z02, etc.) I then attempt to verify the results:
- Merge the split archive back into a single file: /usr/bin/zip -s 0 movie_pieces.zip --out merged_pieces.zip
- Extract the file from the merged archive: /usr/bin/unzip merged_pieces.zip
The second step results in a "bad CRC 68c9a443. (should be af5f6029)" message and an unusable file. Looking at the merged archive and extracted file, which should both be the size of the original movie file, I find they're much smaller—exactly twice the size of a segment of the split archive. This suggests that when merging only two out of the twelve pieces of the split archive are being concatenated. I re-ran the merge command, this time with the -v flag, and got the message:
"zip warning: needs unzip 4.5 on system type 0: movie_file.mov"
Executing "/usr/bin/unzip -v" tells me I'm running unzip version 6.00.
I've run a few additional tests and found that if I try this with considerably smaller movie files the merge works correctly, but for larger ones like the video file I need to send (3.5GB) they don't reassemble correctly.
Any ideas on things I can try? I run into the same problem on both Intel Core i9 and M2 Pro Macs running the most recent version of macOS Sequoia.