1 # Prints messages on every chunk write.
3 # perl mfh.pl zipfile.zip
6 use Archive::Zip qw(:ERROR_CODES);
7 use Archive::Zip::MockFileHandle;
9 package NedsFileHandle;
11 @ISA = qw( Archive::Zip::MockFileHandle );
17 my $length = length($bytes);
18 printf "write %d bytes (position now %d)\n", $length, $self->tell();
24 my $zip = Archive::Zip->new();
25 my $status = $zip->read($ARGV[0]);
26 exit $status if $status != AZ_OK;
28 my $fh = NedsFileHandle->new();
29 $zip->writeToFileHandle($fh, 0);