NullLogic

...

#!/usr/bin/nsp function commas(n) { if ((n=math.floor(n))>=1000) { return commas(n/1000)+","+string.sub(n.tostring(), -3); } else { return n.tostring(); } } print("<h1>INDEX OF ", _SERVER['REQUEST_URI'], "</h1>"); print("<pre><font size=2>"); if (_SERVER['PWD']!=null) { _d=dirlist(_SERVER['PWD']); } else { _d=dirlist(_filepath); } print("<table border=1 width=100%>\n"); foreach (x in _d) { if (string.cmp(x.name, '.')==0) continue; print("<tr>"); print("<td>", x.type, "</td>"); if (x.type=='dir') { print("<td><a href='", x.name, "/'>", x.name, "</a></td>"); print("<td align='right'> </td>"); } else { print("<td><a href='", x.name, "'>", x.name, "</a></td>"); print("<td align='right'>", commas(x.size), "</td>"); } print("<td>", time.sqldate(x.mtime), " ", time.sqltime(x.mtime), "</td>"); print("</tr>\n"); } print("</table>\n"); print("\truntime = ", runtime(), " seconds\n"); print("</font></pre>\n");