
Maebius
Novice
Dec 29, 2000, 8:50 AM
Post #2 of 3
(193 views)
|
Well, it really depends on what type of files you want listed. All files? If so, here is a quick and dirty script that should do that. (note, all paths and filenames are generic and should be altered to suit your site). $dir= shift || '.'; opendir DIR, $dir or die "Can't open directory $dir: $!\n"; while ($file= readdir DIR) { print "Found a file: '$file'\n"; } Note that this will return the ENTIRE contents of the directory (including the other directories '.' and '..') In order to just find actual files, you might want to try something like this: while ($file= readdir DIR) { next if $file=~/^\./; print "Found a file: '$file'\n"; } is a decent workaround for this. I'm sure there are even better ways of doing this, but this particular method works for me. living life -umop apisdn- maebius@everthorn.net
|