[fpc-pascal] [RFC] Modification to packages/paszlib/src/zipper.pp

Michael Van Canneyt michael at freepascal.org
Sun Sep 28 16:39:33 CEST 2008



On Sun, 28 Sep 2008, Michael Van Canneyt wrote:

> 
> 
> On Sun, 28 Sep 2008, Brad Campbell wrote:
> 
> > With reference to this thread..
> > http://www.nabble.com/FPC-Zip-library-td15145102.html
> > 
> > and the resulting bug entry..
> > http://bugs.freepascal.org/view.php?id=10787
> > 
> > I had a similar requirement, so I went and had a crack at patching zipper.pas.
> > 
> > It does precisely what _I_ want it to do, but it's not the cleanest of hacks
> > and I wonder if there is a better way to do it?
> 
> The proper way is to create a new collection item
> 
>   TZipFileEntry = Class(TcollectionItem)
>     ArchiveFileName : String;
>     DiskFileName : String;
>     FStream : TStream;
>   end;
>  
>   TZipFileEntries = Class(TCollection)
>   end;
> 
> And add an overloaded call
> 
>   ZipFiles(AFileName : String; Files : TZipFileEntries);

Implemented as proposed (rev. 11833). 

I updated TUnZipper so it works with TZipFileEntry as well.

It is now also possible to provide the input through streams. (size is needed, so
not every stream can be used).

Michael.



More information about the fpc-pascal mailing list