ZipArchive icon indicating copy to clipboard operation
ZipArchive copied to clipboard

below iOS 11.0 version files traversal order is different from above …

Open Xchenchen opened this issue 6 years ago • 1 comments

…11.0,causes CRC and md5 values to be inconsistent after createZip.

Xchenchen avatar May 30 '19 09:05 Xchenchen

@Xchenchen can you share more information on this? So I understand the issue, if a zip file is created pre-iOS 11 and the same files are used post iOS 11, the two zips will not be equivalent? Does this always occur or is it inconsistent?

jhudsonWA avatar May 29 '21 14:05 jhudsonWA

I can see the benefit of such ordering for the stability of the created archive. However, as it has a possible performance impact, can we clarify if that sorting is required before iOS 11 or after iOS 11? If it's an issue only before iOS 11, then I'd like to have this sorting ONLY for older versions. If it's an issue after iOS 11, then we may want to double check with Apple why the file enumerator isn't sorted, because that seems suspicious. Also, a comment above that sorting would be nice to explain why we're doing it.

Coeur avatar Jul 22 '23 14:07 Coeur

I can see the benefit of such ordering for the stability of the created archive. However, as it has a possible performance impact, can we clarify if that sorting is required before iOS 11 or after iOS 11? If it's an issue only before iOS 11, then I'd like to have this sorting ONLY for older versions. If it's an issue after iOS 11, then we may want to double check with Apple why the file enumerator isn't sorted, because that seems suspicious. Also, a comment above that sorting would be nice to explain why we're doing it.

Do we care? We no longer support iOS that far back.

jhudsonWA avatar Jul 25 '23 00:07 jhudsonWA

Ah lol, right. Then I think it's good to close this pull request without merging it. I don't want to add a potentially perf-sensible step (imagine that we're zipping the Linux distribution, it would have to enumerate all the 10000+ paths and sort them before starting to compress them). Or if we really want that sorting feature, then let's have it as an optional parameter in the API, not as a forced step.

Coeur avatar Jul 28 '23 17:07 Coeur