Contents - Index


Creating Spanned Disk Zip Files


 

  

Spanned zip files are single zip files that span across multiple disks.   This allows you to backup more files than would otherwise fit onto a single disktette.  To create a spanned disk set do the following: 

 

Optionally define an OnGetNextDisk event that will allow the disk to be swapped.   If you do not provide an OnGetNextDisk event, then VCLZip Pro will internally call the DefaultGetNextDisk method which VCLZip Pro provides.

Set the ZipName Property to a path and filename that is on a removable disk such as 'A:\BACKUP.ZIP'. 

Set the MultiMode Property to mmSpan 

If you want VCLZip to write labels on the disks, like PKZIP does, then set the MultiZipInfo.WriteDiskLabels property to True. (note that with CD's this is sometimes difficult)  The first disk will contain the label PKBACK# 001, the second will contain PKBACK# 002, and so on.  

Specify the files you want zipped by adding filespecs and/or wildcards to the FilesList Property.  

Call the Zip Method

 

IMPORTANT:   Normally, PKZip compatible spanned zip files require that the LAST disk of the disk set be inserted first in order to open up the zip file.  This often creates confusion and is an annoyance.  VCLZip has the unique capability to create and read spanned zip files which will allow VCLZip to open a spanned zip file from the first disk.  This option does not cause the spanned zip file to be non-PKZip compatible as PKZip, WinZip, and all of the other zip utilities can still open and read the spanned zip file normally.  However, VCLZip will, if this option is set to True, write some extra information onto the first disk in a separate file.  VCLZip will detect this file if the first disk is inserted first, and read from it, the information it would otherwise need the last disk to obtain.  For further information see SaveZipInfoOnFirstDisk.  

 

Example:  First, define your OnGetNextDisk procedure that allows the disk to be swapped. (Note that beginning with version 2.17, this step is optional.  If you do not provide an OnGetNextDisk event, then a default one is provided for you)...

 

procedure TVCLZipForm.ZipperGetNextDisk(Sender: TObject;  NextDisk: Integer; var FName: String); 

var 

MsgArray: String; 

begin 

Screen.Cursor := crDefault; 

MsgArray := 'Please insert disk ' + IntToStr(NextDisk) + ' of the multi-disk set.'; 

If MessageDlg(MsgArray,mtConfirmation,[mbOK,mbCancel],0) = mrCancel then 

FName := '';  /* Set FName to '' to cancel */ 

Screen.Cursor := crHourGlass; 

end

 

And in your code that does the zipping... 

 

With VCLZip1 do 

begin 

ZipName := 'A:\BACKUP.ZIP'; 

MultiZipInfo.MultiMode := mmSpan;   /* Set to span disks */ 

MultiZipInfo.WriteDiskLabels := True;   /*Actually this is the default*/ 

MultiZipInfo.SaveOnFirstDisk := 200000;  /* Optional to save room on first disk */ 

FilesList.Add('C:\MYFILES\*.*'); 

Recurse := True;   /* Recurse directories */ 

Zip; 

end; 

  

And that's it!  Each disk will be filled with a zip file part.  Each disk will contain a file by the same name, in the example above, each disk will contain a file called BACKUP.ZIP.  The file will take up as much room as is available on each disk. So, if you would like other files to be on any of the disks, be sure to put them there first.  

 

Also note that a spanned disk set can be created by copying individual files from a  Blocked Zip File, each to a separate diskette.