> > Tom, that is exactly how the script works for a moment ;)
> And that is
> > why I'm concerned ;) Because: I have to generate ALL the
> files before
> > moving them into the archive. I can't do this:
> >
> > foreach my $i (@whatever) {
> > $file = generate_file($i)
> > add $file to zip
> > delete $file
> > }
>
> No, but you can do this:
>
> my $zip = Archive::Zip->new();
> my $status = $zip->writeToFileNamed($archive_name);
> die "Error: unable to create zip archive\n" unless $status == AZ_OK;
>
> foreach my $i (@whatever) {
> my $file = &generate_file($i)
> $zip = Archive::Zip->new();
> $zip->read($archive_name);
> $zip->addFile($file);
> $zip->overwrite();
> unlink $file || print STDERR "Warning: unable to delete
> \"$file\"\n";
> }
>
>
> > This matters when $whatever == 100000, doesn't it? ;)
>
> I don't know whether read(), addFile(), overwrite() performs
> the append
> efficiently or not, but I believe this is the most straightforward way
> to do an append using Archive::Zip.
>
>
Thank you! That works.
However, as the zip gets bigger the perfomance suffers aloud. Which is no
surprise for the programm has to reread and rewrite zip every cycle round.
Best regards,
Artem A. Avetisyan.
_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs