From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Perlmutter, Joshua B
Sent: 15 March 2007 15:02
To: [email protected]
Subject: Archive::Zip not Ingesting Directories
> Dear Gurus-
>
> I have a feeling that this will turn out to be user error
Commonly referred to as a problem between keyboard and chair. I think
most people experience those kinds of errors. I know I do.
>
> 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);
It may have been mentioned before, but you shouldn't call subs with the
'&' prefix, unless you know what it does and you actually need it, which
should be pretty rare.
> 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]
Do $webloc and $polloc actually evaluate to a true value? You don't say.
Do the directories actually exist? You don't say, and you don't
explicitly check.
Perhaps you should also check the result of the addDirectory and addFile
calls.
I don't understand the sentence "The flat file has been moved several
times as to where I ingest that." means, or how it is relevant.
HTH
--
Brian Raven
=========================================
Atos Euronext Market Solutions Disclaimer
=========================================
The information contained in this e-mail is confidential and solely for the
intended addressee(s). Unauthorised reproduction, disclosure, modification,
and/or distribution of this email may be unlawful.
If you have received this email in error, please notify the sender immediately
and delete it from your system. The views expressed in this message do not
necessarily reflect those of Atos Euronext Market Solutions.
Atos Euronext Market Solutions Limited - Registered in England & Wales with
registration no. 3962327. Registered office address at 25 Bank Street London
E14 5NQ United Kingdom.
Atos Euronext Market Solutions SAS - Registered in France with registration no.
425 100 294. Registered office address at 6/8 Boulevard Haussmann 75009 Paris
France.
L'information contenue dans cet e-mail est confidentielle et uniquement
destinee a la (aux) personnes a laquelle (auxquelle(s)) elle est adressee.
Toute copie, publication ou diffusion de cet email est interdite. Si cet e-mail
vous parvient par erreur, nous vous prions de bien vouloir prevenir
l'expediteur immediatement et d'effacer le e-mail et annexes jointes de votre
systeme. Le contenu de ce message electronique ne represente pas necessairement
la position ou le point de vue d'Atos Euronext Market Solutions.
Atos Euronext Market Solutions Limited Société de droit anglais, enregistrée au
Royaume Uni sous le numéro 3962327, dont le siège social se situe 25 Bank
Street E14 5NQ Londres Royaume Uni.
Atos Euronext Market Solutions SAS, société par actions simplifiée, enregistré
au registre dui commerce et des sociétés sous le numéro 425 100 294 RCS Paris
et dont le siège social se situe 6/8 Boulevard Haussmann 75009 Paris France.
=========================================
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs