Thank you so much. This one gives an error due
to the GCC compiler not being installed.
I'm not going to install that right now, but I
am going to file this away for the future. I'm
sure I will want to do this in the future.
Thank you very much.
Mike
On 12/7/2014 9:29 AM, Omega -1911 wrote:
Perhaps you could use: Archive::Extract
#!/usr/bin/perl -w
$| = 1;
BEGIN {open (STDERR, ">>error.txt"); }
print "Content-type: text/html\n\n";
use Archive::Extract;
use CGI::Carp qw/fatalsToBrowser/;
use File::Find;
use Cwd;
my $dir = cwd();
my $time = time;
my $cnt = 0;
my $who ='';
my $ok = '';
sub rm();
@directories = ("$dir/downloads/tamp");
find(\&rm, @directories);
sub rm() {
my ($filename) = $_;
# $File::Find::dir contains the current directory
# $File::Find::name contains the complete path name (dir + filename)
# $_ or $filename contains the filename alone.
my $temp_webfile = "$File::Find::name" . "_temp";
if (($filename =~ /\.(zip|tar)$/i) && ($filename !~ /search_edit/i)) {
$cnt++;
$who = $File::Find::name;
my($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks)
= stat($who);
$who = Archive::Extract->new( archive => "$who" )
$ok = $who->extract( to => "$dir/adult/plog-content/uploads" );
print "$cnt\t$filename\tcreated: $ctime\tCHMOD: $mode \n<br>";
}
}
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/