Closed victor-bert closed 5 years ago
@victor-bert Can you show me the code you were using?
Is this the issue?
First create a zip file
# echo abcd | zip /tmp/x.zip -
updating: - (stored 0%)
The run this code
use warnings;
use strict;
use Archive::Zip::SimpleUnzip qw($SimpleUnzipError) ;
my $zipfile = "/tmp/x.zip";
my $z = new Archive::Zip::SimpleUnzip $zipfile
or die "Cannot open zip file: $SimpleUnzipError\n" ;
while (my $member = $z->next())
{
my $name = $member->name();
print "member $name\n" ;
my $fh = $member->open();
while (<$fh>)
{
}
$member->extract("out")
or die "cannot extact: $SimpleUnzipError\n";
}
And finally note that the file out
is empty.
# ls -l out
-rw-rw-r-- 1 root root 0 Oct 24 16:45 out
@victor-bert Can you show me the code you were using?
Here my code:
use feature qw/say/;
my $zip = new Archive::Zip::SimpleUnzip($zipfile)
or die "Cannot open zip file: $SimpleUnzipError\n" ;
my $member = $zip->member('example.txt');
say $member->content; # need to check content
$member->extract($path); # inside extract() content is empty, file extracted empty
Thanks. I see what the issue is.
Fixed in change 76943104cfce9e3ee4a4772b115fdb89faefa6fc
When i try extract file after read his content, file extracted is empty I guess need to seek curent position of file, but Member hasn't this method.