There are a couple of workarounds for this: #The unarchiver failed to write file zip fileThe headers there have much more clear information if the zip file is actually a split zip file or not. The right way for any tool to check for a split zip file is to check the headers in the end of central directory record, and not just the first 4 bytes of the zip file. For this reason, it is totally valid to have the first 4 bytes as a split header for a non-split zip file. By the time we know this information, we have already written the 4 byte split zip header. And since the first 4 bytes have to be written before the start of compression, it will be hard to predict upfront if the final size will be less than the split size or not. If you are adding a 200kb file to a zip and set the split size to 100kb, it might seem that there should be 2 parts to it, but after compression, depending on the file, the compressed size, and the total size of the zip, might end up being less than 100kb. The reason is that, it is hard to predict upfront wether a zip file will end up being a split zip file or not. But it is totally valid to have such a header even for non-split zip files. #The unarchiver failed to write file archiveNow it might sound reasonable that Mac's Archive utility fails in this case, as it found a split zip header for a non-split zip file. This ends up in a situation where a zip file has the first 4 bytes as split zip header, but in fact, the zip file is not a split zip file, and has only one part (because of the reason mentioned above), and since Mac's Archive utility does not support split zip files, it throws an error. In this case, these 4 bytes end up being the split zip header. According to the zip specification, a split zip file has to have a 4 byte split zip header as the first 4 bytes of the first part of the zip file. For example, if the createSplitZipFile() method was called with a split size of 100kb and the total size of the zip file ends up being only 60kb, then there will be only one zip file (filename.zip) instead of (filename.z01, filename.z02. In this case, a zip file was created with ZipFile.createSplitZipFile() method, and the generated zip file ended up being only one part because the total size of the zip file was less than the split size passed in the method argument. You can also skip to the last paragraph for a conclusion/summary of this issue. This will go into the details of the issue, which might not be interesting for everyone, but this will be a reference for me for the future or for anyone else facing similar issues. Read on for more technical details of this issue. This is a limitation of the Mac's Archive utility.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |