in reply to Zip::Archive creates unwanted empty directory

I believe the empty tree is put there so the extracting software can extract it to exactly where it came from. That is, when extracting the program can create C:...carl. I suggest something like:
my $dir = 'C:\Windows\Desktop\carl\zip\mysql'; my $file = 'C:\Windows\Desktop\carl\test.zip'; my $name = 'backup'; my $zip = Archive::Zip->new(); chdir $dir; $zip->addTree( ".", $name ) == AZ_OK or die("could not add tree"); $zip->writeToFileNamed( $file ) == AZ_OK or die("could not write file");
HTH, --traveler

Replies are listed 'Best First'.
Re: Re: Zip::Archive creates unwanted empty directory
by fireartist (Chaplain) on Jul 29, 2002 at 09:50 UTC
    This gives me exactly what I was wanting,
    Thanks!