简体   繁体   中英

Using ZLib unit to compress files vs using ZipForge

There are many questions on zipping in Delphi, anyway this is not a duplicate.

I am using ZipForge for zip/unzip capability in my application.

Currently I use 2 features of ZipForge:

1) zip and unzip (!)

2) password protect the archives

Now I am removing the password from all the archives so I need only to zip and unzip files. I zip them just for minimizing bandwith when uploading/downloading files from the server. So my idea is to process all files once for unzipping them (with password) and rezipping them without password.

I have nothing against ZipForge, anyway it is an extra component, every time I upgrade to a newest Delphi version I have to wait for the new IDE support and moreover the more components the more problems during the installation (I don't mention the cost since it is very low, and replacing a component with some other thing costs time, so it is not a cost issue).

So since what I do is very simple I'd like to replace ZipForge with 2 simple functions using the ZLib unit. I found (and tested) the functions here on Torry's .

What do you think of using Zlib unit? Do you see any potential problem that I would not have with ZipForge? Can you comment on speed?

Well, ZLib out-of-the-box is not ZIP and if you need to create ZIP files which should be unpacked by third-party software, you will have to write extra code to actually ZIP files. If you use your own code to perform both compression and decompression, you can go with ZLib. But still you will be reinventing the wheel by creating your own convention of passing file names etc. And you still need to use a third-party library.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM