#!/mod/bin/jimsh
package require cgi
source /mod/webif/lib/setup
httpheader
set root [cgi_get dir]
set files [lsort [readdir -nocomplain $root]]
puts "
"
foreach dir $files {
set path "$root/$dir"
regsub -all -- {\/+} $path "/" path
if {![file isdirectory $path]} continue
puts -nonewline "- [cgi_quote_html $dir]
"
}
foreach file $files {
set path "$root/$file"
regsub -all -- {\/+} $path "/" path
if {[file isdirectory $path]} continue
set ext [file extension $file]
puts -nonewline "- "
puts -nonewline ""
puts -nonewline [cgi_quote_html $file]
puts "
"
}
puts "
"