use CGI qw(:all); use strict; print header; my $mp3dir="C:\\My Documents\\My Music"; #change this to your filedir my @subs=&findfiles($mp3dir); sub findfiles { my ($currdir)=@_; opendir(MP3ROOTDIR, $currdir); my @allfiles=grep(!/^\.\.?$/, readdir MP3ROOTDIR); closedir(MP3ROOTDIR); my @subdirs=grep(!/.*\..*/, @allfiles); my @rootfiles=grep(/.*\.mp3/i, @allfiles); #change extension to what +ever you want... $currdir=~/^.*\\(.*)$/; print "$1"; foreach (@rootfiles) { my $file=substr($_, 0, -4); #cuts the .mp3 extension... print "<A href=\"$currdir\\$_\"> $file <\/a> <P>"; } foreach (@subdirs) { &findfiles("$currdir\\$_"); } return @subdirs; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: file (mp3) list shown on website as links
by ichimunki (Priest) on Dec 23, 2000 at 20:45 UTC | |
by Nimster (Sexton) on Dec 23, 2000 at 22:35 UTC | |
by ichimunki (Priest) on Dec 24, 2000 at 02:13 UTC | |
by salvadors (Pilgrim) on Dec 31, 2000 at 03:07 UTC | |
by ichimunki (Priest) on Dec 31, 2000 at 18:17 UTC | |
|