When I unzip a file, it contains empty folders. One for each folder in the path to the folder that is being backed up.
I have looked at the AZ docs and cannot find anything that addresses this. There is something about trees, but to someone with my experience in Archive::Zip, this is about as clear as mud.
The actual zipping code is below (only Archive::Zip is used). How do I only end up with the target folder and none of the rest?
- Code: Select all
sub doBakup {
$obj = Archive::Zip->new();
foreach $file (@files) {$obj->addFile($file);}
if ($obj->writeToFileNamed("$bkdir/$zipname.zip") != AZ_OK) {
print qq ~Error cannot create backup!~;
} else {
print qq ~<b>($zipname)</b> has been archived.~;
}
Hope someone can help.
Thanks - Ted




