creating htmls from a directory tree?

Anton Shterenlikht mexas at bristol.ac.uk
Wed Feb 10 22:45:24 UTC 2010


On Wed, Feb 10, 2010 at 11:59:32AM -0500, Nathan Vidican wrote:
> Could do something simple with a Perl script as such:
> 
> #!/usr/bin/perl
> 
> use strict;
> my @filenames = `ls`;
> 
> print "Content-type: text/html\n\n";
> 
> print "See the list below, click an item to open it: <br>\n<lui>\n";
> foreach my $F (@files) {
>   print "  <li><a href=\"$F\">$F</a></li>\n";
> }
> print "</lui>\n";
> 
> # EOF
> 
> You could, of course, get much fancier as it goes - but that's the quick and
> dirty of doing it with a simple cgi script anyways.

many thanks
anton


-- 
Anton Shterenlikht
Room 2.6, Queen's Building
Mech Eng Dept
Bristol University
University Walk, Bristol BS8 1TR, UK
Tel: +44 (0)117 331 5944
Fax: +44 (0)117 929 4423


More information about the freebsd-questions mailing list