$directory Files"; print "\n\n"; $output = `ls -p`; $tempFileNames = split("[\n]+",$output); natcasesort($tempFileNames); reset($tempFileNames); $fileNames = $tempFileNames; $i = 0; while (list ($key, $val) = each ($tempFileNames)) { if(strlen($val) > 0) { $fileNames[$i] = $val; $i++; }; }; $numFiles = $i; print "

These files are available in the $directory directory.

"; print "\n"; print "\n"; print "\n "; print "\n "; print "\n"; print "\n
"; for($i = 0; $i < ($numFiles/2); $i++) { print "\n
$fileNames[$i]"; }; print "\n
"; for(; $i < $numFiles; $i++) { print "\n
$fileNames[$i]"; }; print "\n
"; ?>