TZipFile Improvements in Delphi 12

As you may already have heard from others: Delphi 12 is around the corner and I was giving permission by Embarcadero to blog about some new features. This article is about some improvements made to TZipFile in Delphi 12.

Disclaimer: This blog post is based on a pre-release version of the RAD Studio software and it has been written with specific permission by Embarcadero. No feature is committed until the product GA release.

There are some minor ones like providing ModifiedTime and FileAttributes properties in TZipHeader with Delphi types, eliminating the need to do the conversion in our own code. With Delphi 12 the Deflate64 compression method is supported as well as files larger than 4GB on Win64.

While Delete has been added to TZipFile in Delphi 11 already, there will now be a Rename as well as an AddDirectory to add a complete folder in one call.

An interesting addition – especially for me personally – is the support for encryption. Although there is no implementation delivered for legal reasons, TZipFile accepts an interface in its new Cryptor property allowing to have an external implementation for whatever encryption is required.

The pretty lean interface IZipCryptor is declared like this:

Of course, I already have prepared an implementation for the Traditional PKWARE Encryption as used in EncryptedZipFile, which will be publicly available short after the release.

I am confident that we won’t have to wait long for other implementations making use of commonly known encryption libraries for Delphi.

Author: Uwe Raabe

Addicted to Pascal/Delphi since the late 70's