[delphizip] Re: Pulling files from zip ...

  • From: "Roger Aelbrecht" <Roger.Aelbrecht@xxxxxxxxxx>
  • To: <delphizip@xxxxxxxxxxxxx>
  • Date: Wed, 6 Nov 2002 18:48:06 +0100

HI Gavin

I don't have a ready made solution, but I took a look in the UnzipDll.
I think you could use the extract to Stream method.

Then in Inflate.c in the function inflate_codes
the inflated bytes are written byte by byte to a buffer
redirSlide[]  which is the same as pG->redirect_pointer which is in its
turn the ZipStream-Memory

I think you can add what you want in this function at the spot where the
test for buffersize 0x8000 is made to give a progress user_callback.

If you use a user call_back you can read the buffer as it is filled so far
in the application and on return from the application you could reset the
pointer.

Be aware that you need to do something about the CRC calculation and
checking since that will probably fail and if you don't want the total file
you have to avoid the FLUSH

HTH

Roger Aelbrecht
http://web.wanadoo.be/driehoeksw
> ----- Original Message -----
> From: "Gavin Morris" <gavin@xxxxxxxxxx>
> To: <delphizip@xxxxxxxxxxxxx>
> Sent: Tuesday, November 05, 2002 7:27 AM
> Subject: [delphizip] Pulling files from zip ...
>
>
> >
> > Hi all,
> >
> > I have need of some code that, rather than extracting a zipped file to a
=
> > stream
> > in it's entirety, decompresses it a chunk at a time and allows the app =
> > to read
> > the requested number of bytes out of the decompress buffer.
> >
> > I'm reading and processing data from compressed text files, each of =
> > which is
> > large enough to make extracting each file fully impractical.
> >
> > I'm currently examining the source to the unzip DLL to see if it can be
=
> > modified
> > to allow this, but I have some questions:
> >
> > - are there good technical reasons the DLL provides the push interface =
> > to extraction?
> > - has anyone gone over this ground already?
> > - Is there existing functionality to do this that I've missed?
> >
> > Hope someone can help.
> >
> > -G
> >
> > ---
> > Gavin Morris, BSc
> > gavin@xxxxxxxxxx
> >
>
>
>



Other related posts: