I have try to use lfs module. My test code is here:
--------------------------------------------------------------------------
<?
mg.write('HTTP/1.0 200 OK\r\nContent-Type: text/html\r\n\r\n')
local l = require("lfs")
for f in lfs.dir("/") do
mg.write(f)
end
?>
----------------------------------------------------------------------------
I have try to compile lfs to lfs.so,and put it in the same path with my code.
There is nothing in the browser,even when I delete the "require" line, there is nothing,not a error log.
In the terminal,it runs well like this:
----------------------------------------------
$lua admin.lua
HTTP/1.0 200 OK
Content-Type: text/html
dev
sys
etc
mnt
...
--------------------------------------------
the lfs.so is here:
$ ls
admin.lp admin.lua data edit.lp index.lp js lfs.so list.lp page.lp test.lua
Who knows how to let it work? Millions of Thanks.