开发者

Using ZLib unit to compress files vs using ZipForge

开发者 https://www.devze.com 2023-01-03 17:19 出处:网络
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.

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 f开发者_Python百科or 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号