M
Mark Newman
Not sure if this is a known problem or not, so here goes... I'm using
ActivePerl 5.8.3.809, trying to write a fairly simple piece of code that
will grab all of the management web pages from device that I have, and
then create a tar file with the all of the files inside of it. I have
no problem grabbing the html files, and even creating a flat tar file.
The problem occurs when I try to create some sort of directory structure
inside of the tar file (so that I can grab files from multiple devices,
and file them say by IP address). Every attempt that I have made to get
Archive::Tar to accept a nested file name is ignored. Here is sample code:
sub generateElement
{
my $hostName = shift;
my $pwd = shift;
my $deviceType = shift;
my @deviceTemplate = @{$Templates{$deviceType}};
for(my $i= 0; $i < scalar(@deviceTemplate); $i += 2)
{
print "$deviceTemplate[$i] -> $deviceTemplate[$i+1] \n";
if(!$www->doURLQuery("http://$hostName/$deviceTemplate[$i+1]"))
{
print "ERROR: $hostName = " . $www->getErrorMessage() . "\n";
} else {
$tar->add_data("dir1\\$deviceTemplate[$i+1]",$www->httpResponse());
}
}
}
The various webpages are successfully grabbed and stored in a .tar file,
but the "dir1\\" path is ignored. All files are in the root directory.
Any suggestions?
Thanks,
Mark
ActivePerl 5.8.3.809, trying to write a fairly simple piece of code that
will grab all of the management web pages from device that I have, and
then create a tar file with the all of the files inside of it. I have
no problem grabbing the html files, and even creating a flat tar file.
The problem occurs when I try to create some sort of directory structure
inside of the tar file (so that I can grab files from multiple devices,
and file them say by IP address). Every attempt that I have made to get
Archive::Tar to accept a nested file name is ignored. Here is sample code:
sub generateElement
{
my $hostName = shift;
my $pwd = shift;
my $deviceType = shift;
my @deviceTemplate = @{$Templates{$deviceType}};
for(my $i= 0; $i < scalar(@deviceTemplate); $i += 2)
{
print "$deviceTemplate[$i] -> $deviceTemplate[$i+1] \n";
if(!$www->doURLQuery("http://$hostName/$deviceTemplate[$i+1]"))
{
print "ERROR: $hostName = " . $www->getErrorMessage() . "\n";
} else {
$tar->add_data("dir1\\$deviceTemplate[$i+1]",$www->httpResponse());
}
}
}
The various webpages are successfully grabbed and stored in a .tar file,
but the "dir1\\" path is ignored. All files are in the root directory.
Any suggestions?
Thanks,
Mark