#!/usr/bin/perl # # IMAGES.CGI # by Matt Kruse (mkruse@saunix.sau.edu) # 8/20/95 # # images.cgi is a simple script that will create an HTML index of all # images in the current directory and write it out to images.html # The page contains the images, links to the images themselves, their # names, and their sizes. # # USAGE: images.cgi # examples: images.cgi *.gif # images.cgi *.gif *.jpg # images.cgi a.gif b.gif c.gif d.gif # $DIR=`pwd`; open(HTML,"> images.html"); print HTML < Image Index

Image Index

The following images are in the directory: $DIR


EOF foreach (@ARGV) { print STDOUT "Adding $_ ...\n"; $SIZE=(-s $_); print HTML "\n"; print HTML "\"[\n"; print HTML " $_ ($SIZE bytes)

\n"; } print HTML "


\n\n\n"; close(HTML); print STDOUT "Done.\n\n";