Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I need a directory listing script!!

Status
Not open for further replies.

ElBlues

Programmer
Jul 1, 2004
13
0
0
GB
What I am attempting to do is create a list of files in a directory, which can be downloaded from a html page.

SSI is enabled on the site, can anyone point me in the direction of a script that might do what I want?

Thanks
El
 
# See code below...
# hope that helps..
# save code as cgi...or pl..

use strict;

my $out_file = "myfile.htm"; #change
my $dir = "yourdir";
# on win os make sure you double # eg c:\\winnt\\etc...

open(FH, ">$out_file") ||die "Boo boo";
opendir(DH, $dir) ||die "boo boo";
while($file = readdir(DH)){
next if $file =~ m/^(\.|\.\.)/;
print FH "/$outfile<br>\n"; #add/change to change result.
}
closedir(DH);
close FH;

[ponder]KrK
 
Hey, ElBlues...
Earlier this year, I wrote a web application I call "Download Search Engine". It may be what you're looking for. I have a zip of the script, readme and the necessary image files. If interested, email me vego_661@hotmail.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top