#!/usr/bin/perl # Directory indexer. # perl dir_index.pl directory_path 'Title' # # directory_path is required but 'Title' can be ignored and defaults to # "Directory Index page" # 06/01/2003 njc - I needed a program to create directory indexing as Comcast # doesn't permit access to the directories directly. I may add # a description file describing each program (later). my ($fname, $fsize, $fdate); my ($dir, $name) = @ARGV; defined($dir) || die "Must give directory to switch to.\n"; if(!defined($name)) { $name = "Directory Index page"; } chdir($dir) || die "Can not cd to $dir ($!)\n"; open OUT, ">index.html"; open DIR, "ls -l|"; print OUT "\n"; print OUT "
| $fname | $fsize | $fdate |