Contents - Index - Previous - Next
OnRecursingFile Event
Applies to
TVCLZip component
Declaration
property OnRecursingFile: TOnRecursingFile = procedure(Sender: TObject; FName: string); of object;
Description
The OnRecursingFile event is called when VCLZip is recursing directories, searching for files that satisfy a wildcard that was entered into the FilesList Property. It is called for each file that is found that meets the criteria. The FName parameter contains the filename of the file that was just found that meets the wildcard criteria.
For instance if you did the following:
TVCLZip.Recurse := True; TVCLZip.RootDir := 'c:\mydirs'; TVCLZip.FilesList.Add('*.pas'); NumZipped := TVCLZip.Zip;
This event would be called for every .PAS file as it is found while VCLZip recurses the 'c:\mydir' directory and all of it's subdirectories.
All recursing is done prior to any actual zipping. So this is a good way to show some sort of progress when you are recursing a large directory structure, otherwise your application may seem to be hung while the recursing is progressing. Note that there can still be a long time between event calls if most files in a very large directory structure do not match the wildcard.
For example in your OnRecursingFile event you may wish to do something like the following:
procedure MyForm.OnOnRecursingFile( Sender: TObject; FName: String );
begin
StatusLabel.Caption := FName + ' matches wildcard and will be zipped';
end;
See Also: