function link_dir (dir, base) local path = base.."/"..dir local mode = lfs.attributes (path).mode if mode == "directory" then return string.format ('%s', cgilua.mkurlpath ("test_fs.lua", { dir = path }), dir) else return dir end end cgilua.htmlheader () cgilua.put ("

Testing Filesystem library

\n") cgilua.put ("\n") cgilua.put ("\n") local i = 0 local dir = cgi.dir or "." for file in lfs.dir (dir) do i = i+1 cgilua.put ("\n") end cgilua.put ("
Testing dir
"..i..""..link_dir(file, dir).."
\n")