File: index.cgi

package info (click to toggle)
newlisp 10.7.5-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 6,248 kB
  • sloc: ansic: 33,280; lisp: 4,181; sh: 609; makefile: 215
file content (14 lines) | stat: -rwxr-xr-x 509 bytes parent folder | download | duplicates (28)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/usr/bin/env newlisp

(print  "Content-type: text/html\r\n\r\n")
(println "<h2>" (real-path) "</h2>")

(println {<table>})
(dolist (file (sort (directory)))
    (set 'slash (if (directory? file) "/" ""))
    (println {<tr><td><tt><a href="http:} file slash {">} file  slash {</a>&nbsp;&nbsp;</tt></td><td><tt>}
        (date (last (file-info file)) 0 "%Y-%m-%d %H:%M:%S") {</tt></td>} 
        {<td><pre>} (format "%12.3f KB" (div (file-info file 0) 1000)) {</pre></td></tr>}))
(println {</table>})
(exit)