Hello,
I want to archive a folder containing files into a single file using Apple Archive. So far so good, it works as it should.
Now, the documentation says:
The zlib compression algorithm, which is recommended for cross-platform compression.
The encoded format is the raw DEFLATE format as described in IETF RFC 1951, the following obtains the equivalent configuration of the encoder:
deflateInit2(zstream,5,Z_DEFLATED,-15,8,Z_DEFAULT_STRATEGY)
Thus, I'm using .zlib, because I want the archive to be unarchivable on macOS as well as other, non-Apple platforms.
The thing is, I don't know what file extension to use so it is unarchivable / openable on both macOS and, say, Windows.
Using .aar ("Apple Archive"), or .aea ("Apple Encrypted Archive"), it works on macOS, but I doubt those can be opened on Windows (since it's the Apple-proprietary file format).
- Using .zip doesn't work on macOS, so I doubt it'll work on Windows.
- Using .zlib doesn't work (can't be opened on macOS)
- Usng .z doesn't work (can't be opened on macOS)
So my question is, with a folder compressed using .zlib for cross-platform, what file extension must I use for the resulting archived file so it can be opened with an unarchiving app on macOS and non-Apple platforms?
Thank you for any insights,
Matthias
You are mixing up your terms here:
-
Apple archive is the name of an archive format, much like a tar archive or zip archive.
-
Apple Archive is (confusingly) the name of a framework that implements the Apple archive format.
-
Zlib is a compression format, one that applies to a stream of bytes.
Zlib is a standard stream compression format and support for it shows up in all sorts of places. Apple archive is not a widely adopted archive format and you’ll only find it supported on Apple platforms.
If you want to create an archive to share with other platforms, your best option is to create a zip archive [1]. Unfortunately Apple Archive (the framework) is not able to do this (r. 54528696). Moreover, Apple platforms have no good API for working with zip archives [2]. You will need to write or acquire your own library for this.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
[1] Within that zip archive the individual streams may be compressed by zlib but that’s not that salient point here.
[2] If you only want to create archives, and you can live with its otherh limitations, you can use the technique described in this post.