[delphizip] Re: problem using AddDiskSpan option

  • From: "Roger Aelbrecht" <Aelbrecr@xxxxxxxxxx>
  • To: <delphizip@xxxxxxxxxxxxx>
  • Date: Thu, 29 Jul 2004 19:24:25 +0200

xmormur@xxxxxxxxxxxxx wrote:
> Hi Roger
>
>
>
> I think understand idea, but if file is splitted into 6 parts
> OnProgress.TotalSize2Process should be executed 7 times, or not? 1rst
> for total zip and 6 more for each part created.
>
> In any case if possible was a good idea iclude a way to detect when
> process is xipping and when is splitting.
>
> Thanks for all
>
> Xavi
>
>
No that is not true,
OnProcess.TotalSize2Process comes 2 times.
First time for the Add operation then it is the sum of the uncompressed size
of all files that will be added to the archive.
When adding is complete a temporary zip file is made
Now we start splitting that zipfile into smaller zipfiles at the start
of that operation we have a second OnProgress.TotalSize2Process
and this time the size is the size of the temporary zip file
During the splitting process the files in the archive are copied to the
part files and for each file you get a new OnProgress.NewFile event.

It is very easy to tell when zipping and when splitting
The first is zipping the second is splitting, it cannot be the other way.

If you want to be sure look at the content of the message in OnMessage
event, for zipping it starts with "adding"  for splitting it starts with
"copying"
In next releases we try to have this information in a 'coded' way and maybe
then we can add info about the kind of operation the OnProgress events
are fired.

If you want to know more about this have a look at the files ZBuilder.cpp
and ZipBase.cpp

In ZBuilder.cpp search for function ZBuilder::WriteSpan
and in that function look for code parts
 CallBack(zacSize, 0,"", FFileSize);

Those are the lines that make calls to the ZipBase::Callback functions
in ZipBase.cpp that generates the OnProgress events

HTH

Roger Aelbrecht
http://home.tiscali.be/driehoeksw

-----------
To unsubscribe from this list, send an empty e-mail 
message to:
  delphizip-request@xxxxxxxxxxxxx 
and put the word unsubscribe in the subject.

Other related posts: