Hi. I'm trying to make a TAR file from all the files in the template folder. I currently have;
my $file;
opendir(DIR, $CFG->{admin_root_path}) or die "Can't opendir $CFG->{admin_root_path}: $!\n";
while (defined($file = readdir(DIR))) {
if ($file =~ /\.(html|txt)/i){
push @file_list, $file;
}
}
close(DIR);
my $tar = new GT::Tar;
foreach (@file_list) {
$tar->add_file( $CFG->{admin_root_path} . "/templates/default/" . $_ );
}
$tar->write('Templates.tar');
...however, this gives me;
...line 48 is;
I've taken a look through the plugin managed, but I can't see where new files are added in the plugin wizard.. so it wasn't much help :(
TIA
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Code:
my @file_list; my $file;
opendir(DIR, $CFG->{admin_root_path}) or die "Can't opendir $CFG->{admin_root_path}: $!\n";
while (defined($file = readdir(DIR))) {
if ($file =~ /\.(html|txt)/i){
push @file_list, $file;
}
}
close(DIR);
my $tar = new GT::Tar;
foreach (@file_list) {
$tar->add_file( $CFG->{admin_root_path} . "/templates/default/" . $_ );
}
$tar->write('Templates.tar');
...however, this gives me;
Quote:
GT::Tar (7227): Bad arguments passed to new(). Reason: No output archive passed in at /home/linkssql/linkssql.net/cgi-bin/imageSQL/admin/Plugins/Admin_Make_Temp.pm line 48....line 48 is;
Code:
my $tar = new GT::Tar;I've taken a look through the plugin managed, but I can't see where new files are added in the plugin wizard.. so it wasn't much help :(
TIA
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!