tags:

views:

122

answers:

1

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 functinos 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?

+7  A: 

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.

Eugene Mayevski 'EldoS Corp
Ok in fact after you told me this I realized that I cannot open the files I compress with zlib by using windows zip engine or 7-zip. So I should also ship an "emergency tool" to recover zipped files". Do you iknow which file extension shuold I give to the files zipped with zlib so that they can be unzziped with 7-zip?
None, I am afraid. ZLib doesn't produce "files". It just compresses streams of data. It's you who packs those streams into certain formats that can be later opened with third-party applications. As far as I know, GZIP format is a header + ZLib stream, so you can check it's specification.
Eugene Mayevski 'EldoS Corp