mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-21 11:30:01 +00:00
Added directory scanning example, and enabled posix routines in Lua for unix environment
This commit is contained in:
1 parent
78c994f7cc
commit
74711c686f
2 files changed
+20
-2
No files matched your search
@@ -0,0 +1,15 @@
|
||||
HTTP/1.0 200 OK
|
||||
Content-Type: text/plain
|
||||
|
||||
<?
|
||||
-- Directory scanning example
|
||||
|
||||
function scandir(dir)
|
||||
local t = {}
|
||||
for f in io.popen('dir ' .. dir):lines() do table.insert(t, f) end
|
||||
return t
|
||||
end
|
||||
|
||||
local tab = scandir('C:\\')
|
||||
for k,v in pairs(tab) do mg.write(v, '\n') end
|
||||
?>
|
||||
Reference in new issue
Block a user