Gary,
Did you get the code I emailed you??
I have also this week been doing a more simple directory listing type script for indivual sections of a web site.
Again it's on NT, but that hasn't been a problem.
Basically I have got a directory listing and used grep to get rid of the . and .. files.
Then for each file in a specified directory (which are directories themselves) I have built the path in the script and then gone into each of those directories and accessed an index file (plain text), and got additional info for display from there.
The result is a page that is always up to date and lists different folder names (each in this case is a group of people), and what is contained within that folder i.e. various documents relating to these groups of people.
The main need for the index file is just to add extra text and information that isn't available from the system i.e. group name, main contact etc.
I've put some of the code below;-
opendir(MDS, $startpath) || die "Cannot open $startpath: $!\n";
@dirs=grep(!/^\.\.?$/, readdir MDS);
closedir(MDS);
#you now have an array with the contents of the file.
foreach $files(@dirs) {
$inform = $startpath . $files . $slash . $indexfile;
#print $inform;
open (FIL, $inform) || die "Cannot open data file: $!\n";
@indat = <FIL>;
close FIL;
push (@datafil, [@indat]);
# by now you have all the info from all the index files in a 2 level array and you just loop through printing to the screen.
e.g.
for ($i=0;$i<@datafil;$i++) {
$title = $datafil[$i][0];
print $title;
}
I have had very few problems doing this, and the whole script and a couple of supporting ones run in each frame of a three frame set, with no performance complaints.
The folder of groups contains about 30-50 folders with 10-20 supporting docs each and 20ish lines of text in each index file.
Hope this helps.
Also, since I don't know much ASP, is this kind of thing as easy in ASP?? and also this method requires an index file that is maintained manually for each folder.
Could this index stuff be done using MS index server??
Jez
