#!/usr/local/bin/perl
use File::stat ;
use AnyDBM_File ;
use subs qw( dir_map print_date resolve_query negative_result ) ;
$initial_dir = '/home/stargate/a/sig/artemis/public-web' ;
dir_map ( $initial_dir ); #The sad thing is, I could have easily
#done this w/o
#################################################################
# Everything really is a Subroutine
#
#################################################################
#################################################################
# The main part of this program
sub dir_map {
push @dirs , shift ;
foreach $dir ( @dirs ) {
$dir =~ s/\/\//\//go ;
$inode = stat ( $dir ) ;
open TDIR , "$dir" ;
#If it's a Directory, collect the contents but no printing
# -----------------------------------
if ( -d TDIR ) {
close TDIR ;
my @localdirs ;
my $flag = 0 ;
opendir ( DIR , "$dir" ) or die "Can't open $dir: $!" ;
while ( defined ( $filename = readdir ( DIR ) ) ) {
$flag = 1 if $filename =~ /^(\.nosearch)$/ ;
push @localdirs , "$dir/$filename"
unless $filename =~ /^\./
or $filename =~ /\.jpg/i
or $filename =~ /img/i
or $filename =~ /\.gif/i
or $filename =~ /fig\d/i
or $filename =~ /^gal\d\d\.htm/i
or $filename =~ /^gal\w\d\.htm/i
or $filename =~ /^(images)$/i ;
}
closedir DIR ;
foreach ( sort @localdirs ) {
#print qq(\t$flag\n) if $flag == 1 ;
push @dirs , $_ if $flag == 0 ;
}
#If it's not a Directory, it is a file. Look for whtml and not index
# -----------------------------------
} elsif ( $dir =~ /w?s?html?$/i ) {
my $display ;
$dir = ( split /public-web\// , $dir )[1] ;
$dir =~ s/\/\//\//go ;
my $text ;
my %checker ;
if ( -T TDIR ) {
my $thing ;
$text .= $_ while
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
\n\n) ;
$prev = $_ ;
}
print<