Contents - Index - Previous - Next
OnFileNameForSplitPart event
Applies to
TVCLUnZip component
Declaration
property OnFileNameForSplitPart: TFileNameForSplitPartEvent = procedure(Sender: TObject; var FName: String; PartNum: Integer; SplitType: TSplitPartType); of object;
Description
NOTE: If you do not define this event then the DefaultFileNameForSplitPart method is internally called and will handle both zipping and unzipping cases.
This event is called to create the proper filenames for blocked archives, that is, archives created with MultiMode set to mmBlocks. It is called just before creating each part, including the first part which is numbered 1.
FName is the value of ZipName property with the file extension removed. This should be set to the correct filename for the part about to be made usually by attaching the correct file extension, however you can use whatever filenaming scheme you wish.
PartNum is the number of the part about to be created, starting with 1.
SplitType is one of (spFirst, spMiddle, spLast, spUnknown) depending on whether the part about to be made is the First, one of the Middle, or the Last part of the split archive.
The DefaultFileNameForSplitPart method creates filenames one of two ways, depending on how BlockMode is set. If set to
bmStandard creates files according the pkzip standard. filename.zip becomes filename.zip.z01, filename.zip.z02...filename.zip. The last part is simply the original filename. VCLZip detects that it is a split file.
bmClassic creates files the way VCLZip always created them in the past. filename.zip becomes filename.001, filename.002..filename.nnn. The last filename has the number of the part as the extension.
See DefaultFileNameForSplitPart method for a snapshot of the code at the time of this writing.