14
7
There are times when it is necessary for the files in a ZIP archive to be in a specific order (for example, I'm currently creating EPUBs, which require that the first entry in the ZIP be the mimetype
file). How can I do this on Windows?
I'm currently using 7-Zip as my archiver, but I don't see an option for controlling file order. Can this be done with 7-zip? If not, what options do I have?
No surprise that VMware products require the contents of an OVA file to be in a certain order. – pacoverflow – 2018-04-16T15:40:04.363
3Adding them in the order that they need to be should do this. Try zipping the mimetype file first, then adding the other files to the zip as a second operation. – Paul – 2012-02-03T00:25:49.177
1@Paul — Surprisingly, that didn't work. :-/ – Ben Blank – 2012-02-03T01:01:18.460
Is it LIFO maybe? Can you try adding mimetype last? You are testing against an epub reader right, rather than just unzipping? – Paul – 2012-02-03T01:08:16.943
3A application that requires the contents to be in a specific order is broken. – psusi – 2012-02-03T03:52:24.913
@psusi — I don't disagree, but that's what's in the spec. – Ben Blank – 2012-02-03T05:43:29.040
3Sheesh, the authors of the spec need taken out back and beaten with a clue-by-four. – psusi – 2012-02-03T14:31:41.847
Be aware that the order of the files in the archive is not necessarily the order of the files in the directory, and the directory order is what you'll see (if even that) if you use an unzip tool to "peek" at the directory. The only way to tell the real order is with a hex editor, or a specially-written program. – Daniel R Hicks – 2013-02-06T23:51:52.967
(Adding in order -- as separate steps, not simply listing the files in order in one operation -- should put them in the archive in that order. The only way for this not to happen would be if the archive tool, for some strange reason, decided to rewrite the archive rather than just append to it.) – Daniel R Hicks – 2013-02-06T23:53:30.797