paszlib

From Free Pascal wiki
Revision as of 15:49, 16 February 2009 by Marcov (talk | contribs)
Jump to navigationJump to search

paszlib is a Pascal conversion (thus without dependancies) of the standard zlib library, implemented by Jacques Nomssi Nzali (his old homepage is dead, see a continuation of the project here) It is used in the FCL to implement the TCompressionstream class. The main unit of this package is paszlib. there are other, auxiliary units, but the unly unit that needs to be included in a typical program is this one. (View interface)

TZipper

Using the latest TZipper

In FPC 2.3.1 there are many fixes which make TZipper much better. To be able to use them until the next FPC is released with those fixes one should follow the following steps:

1 - Download zipper.pp, and only this file, from: http://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/packages/paszlib/src/

2 - Rename the file to a unique name, to avoid conflict with the fpc unit, like myzipper.pp and also change the name inside the source file.

3 - Add the file to your project and use the TZipper from there.

Usage example

 FZipper.FileName:=ParamStr(1);
 For I:=2 to ParamCount do
   begin
   F:=TFileStream.Create(ParamStr(i),fmOpenRead);
   FZipper.Entries.AddFileEntry(F,ParamStr(i));
   end;
 FZipper.ZipAllFiles;
 For I:=0 to FZipper.Entries.Count-1 do
   FZipper.Entries[I].Stream.Free;