Thank you Frederick, that worked like a charm.

 

-Josh

 

________________________________

From: Washburn, Frederick [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 15, 2007 11:19 AM
To: Perlmutter, Joshua B; activeperl@listserv.ActiveState.com
Subject: RE: Archive::Zip not Ingesting Directories

 

I use addTree to do this and it works great, following code is an
example:

 

      

      my $zip = Archive::Zip->new();

      my $releaseRoot = "C:\\temp\\release";

      my $rslt = $zip->addTree($releaseRoot);

      $rslt = $zip->writeToFileNamed($zipFile);

      if (!$rslt) {

         print "SUCCESS\n";

      } else {

         AbortWithError("Failed to create zip file for release");

      }

 

________________________________

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Perlmutter, Joshua B
Sent: Thursday, March 15, 2007 8:02 AM
To: activeperl@listserv.ActiveState.com
Subject: Archive::Zip not Ingesting Directories

 

Dear Gurus-

 

I have a feeling that this will turn out to be user error

 

I have the following code snippet and it refuses to zip up the
directories. The flat file has been moved several times as to where I
ingest that. It is the ONLY thing in the zip each time.

It is also the ONLY file that is a relative path and therefore the only
one with an apriori knowledge of where it will be.

 

[code snippet begin]

# create archive using SMInf and configs/logs

# this builds to what should be default logs/configs directories

my $zip = Archive::Zip->new();

&rep("silent debug locations:\nwebloc: $webloc\npolloc: $polloc",0);

if($webloc){

  my $config="$webloc/config/";

  my $logd="$webloc/log/";

  my $dir_member = $zip->addDirectory( $config );

  $dir_member = $zip->addDirectory( $logd );

  &rep("silent debug specific-wa:\nconfig: $config\nlogd: $logd",0);

}

if($polloc){

  my $config="$polloc/config/"; $config =~ s/\\/\//g;

  my $logd="$polloc/log/"; $logd =~ s/\\/\//g;

  my$dir_member = $zip->addDirectory( $config );

  $dir_member = $zip->addDirectory( "$logd" );

  &rep("silent debug specific-ps:\nconfig: $config\nlogd: $logd",0);

}

my $file_member = $zip->addFile( 'SMInf.txt' );

 

unless ( $zip->writeToFileNamed('SMProfile.zip') == AZ_OK ) {

  die "write error-zip: $^O";

}

[code snippet end]

 

Josh Perlmutter

  

This e-mail and any files transmitted with it are for the sole use of
the intended recipient(s) and contain information that may be privileged
and confidential.  Any unauthorized review, use, disclosure or
distribution is prohibited.  If you are not the intended recipient of
this e-mail, please delete this e-mail and any files transmitted with it
and notify the sender immediately.

 

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to