rp_html_directory_listing (private)
rp_html_directory_listing dir
Defined in packages/acs-tcl/tcl/request-processor-procs.tcl
Generates an HTML-formatted listing of a directory. This is mostly stolen from _ns_dirlist in an AOLserver module (fastpath.tcl).
- Parameters:
- dir (required)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
Source code: # Create the table header. set list " <table> <tr align='left'><th>File</th><th>Size</th><th>Date</th></tr> <tr align='left'><td colspan='3'><a href='../'>..</a></td></tr> " # Loop through the files, adding a row to the table for each. foreach file [lsort [glob -nocomplain $dir/*]] { set tailHtml [ns_quotehtml [ad_file tail $file]] set link "<a href=\"$tailHtml\">$tailHtml</a>" # Build the stat array containing information about the file. file stat $file stat set size [expr {$stat(size) / 1000 + 1}]K set mtime $stat(mtime) set time [clock format $mtime -format "%d-%h-%Y %H:%M"] # Write out the row. append list "<tr align='left'><td>$link</td><td>$size</td><td>$time</td></tr>\n" } append list "</table>" return $listXQL Not present: Generic, PostgreSQL, Oracle