[fpc-pascal]What is the best to compress files

memsom at interalpha.co.uk memsom at interalpha.co.uk
Thu Oct 24 17:42:18 CEST 2002


Does FPC have an implementation of ZLib? IIRC it does. This should give you 
most of what you want.

However, if you want a completely self contained solution (ZLib seems to almost 
always need a DLL/So or at least include a larger presence in the final code 
than I needed for my purposes) you may need to look elsewhere. The method I 
always use is LZH compression routines that someone called the 'African Chief' 
has a distro of. I customized them to use TStream descendents, and wrapped them 
in classes, but they do work. The only interesting aspect is that you have to 
manage the file format yourself if you use the raw compression routines alone. 

I suggest looking for another solution if you want to be able to create 'zip' 
or 'tar.gz' compressed files (though tar itself can be used to simplify the 
compression using the Chiefs code.)

I have some code somewhere for a custom self extracting compressed file format 
I created ages ago. If you're desperate let me know and I'll send you the 
compression sections - caution they are in Delphi, so you'll need to compile in 
Delphi come (i.e. Classes instead of Objects) etc.

Hope that helps.

Matt

> Hello.
> What is the best way to compress and decompress files by fpascall programs? 
Are there unit
with good procedures to perform this. Also can these ones to work right with 
national
coding charsets for example russian?
> Thanks.


---------------------------------------------
This message was sent using Mistral WebMail.
http://www.mistral.co.uk/






More information about the fpc-pascal mailing list