It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming CGI and Perl Forum

Too many folders in zipped file

Too many folders in zipped file

Postby Tedh on Wed Aug 11, 2010 5:42 pm

I am able to sip up the folders that I want fine, it works a treat - almost.

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
Tedh
 
Posts: 7
Joined: Mon Aug 10, 2009 9:27 pm

Re: Too many folders in zipped file

Postby Tedh on Sat Aug 14, 2010 6:51 am

Any comers other than spam.
Tedh
 
Posts: 7
Joined: Mon Aug 10, 2009 9:27 pm

Re: Too many folders in zipped file

Postby Tedh on Sat Aug 14, 2010 8:52 pm

Got this sorted. Turns out two other Perl modules are needed as well.
Tedh
 
Posts: 7
Joined: Mon Aug 10, 2009 9:27 pm

Re: Too many folders in zipped file

Postby iDad on Sat Aug 14, 2010 10:38 pm

Sorry no replies to your question, Glad you sorted it out though.Welcome to devppl
PHOTO EDITING
Image
User avatar
iDad
1000+ Club
 
Posts: 1912
Joined: Fri Jul 17, 2009 6:05 pm
Location: USA


Who is online

Users browsing this forum: No registered users and 0 guests