#!/usr/bin/perl

printf("generating vindex.html  ");

`echo "<!DOCTYPE HTML PUBLIC \\"-//IETF//DTD HTML 2.0//EN\\">" > vindex.html`;
`echo "<HTML><HEAD>" >> vindex.html`;
`echo "<title>Index of Lightvectors</title>" >> vindex.html`;
`echo "</HEAD>" >> vindex.html`;
`echo "<BODY>" >> vindex.html`;

`echo "<h1>Dusting Convocation Hall</h1>" >> vindex.html`;
`echo "<h2>http://wearcam.org/ece1766/lightspace/dusting/</h2>" >> vindex.html`;
`echo "<a href=""convocationhall2.jpg"">" >> vindex.html`;
`echo "<img src=""convocationhall2small.jpg""></a>" >> vindex.html`;

`echo "<h1>Index of Lightvectors</h1>" >> vindex.html`;


#for ($counter=0; $counter<=999; $counter++) {

while (defined($nextname = <v???.jpg>)) {

# $filev = sprintf("v%03d.jpg", $counter);
 $filev = $nextname;
# $files = sprintf("s%03d.jpg", $counter);
 $files = sprintf("s%s", $nextname);
# printf("creating html link for file $filev\n");
 printf("creating html link for file $nextname\n");

#`echo "<IMG src=\\"$files\\">" >> vindex.html`;
# `echo "<a href=\\"$filev\\"><IMG src=\\"$files\\"></a>" >> vindex.html`;
 `echo "<a href=\\"$filev\\"><IMG src=\\"$files\\">$filev</a>" >> vindex.html`;

}

`echo "<hr>" >> vindex.html`;
`date >> vindex.html`;
`echo "</BODY>" >> vindex.html`;
`echo "</HTML>" >> vindex.html`;
`echo "" >> vindex.html`;

