Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mongoose
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
esp
mongoose
Commits
74711c68
Commit
74711c68
authored
Nov 23, 2013
by
Sergey Lyubka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added directory scanning example, and enabled posix routines in Lua for unix environment
parent
78c994f7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
2 deletions
+20
-2
lua_5.2.1.h
build/lua_5.2.1.h
+5
-2
dirscan.lp
examples/lua/dirscan.lp
+15
-0
No files found.
build/lua_5.2.1.h
View file @
74711c68
...
...
@@ -18,6 +18,7 @@
** ===================================================================
*/
#define LUA_COMPAT_ALL
/*
@@ LUA_ANSI controls the use of non-ansi features.
...
...
@@ -38,8 +39,6 @@
#define LUA_USE_AFORMAT
/* assume 'printf' handles 'aA' specifiers */
#endif
#if defined(LUA_USE_LINUX)
#define LUA_USE_POSIX
#define LUA_USE_DLOPEN
/* needs an extra library: -ldl */
...
...
@@ -59,6 +58,10 @@
#endif
#if defined(__posix) || defined(__linux) || \
defined(__unix) || defined(__APPLE__)
#define LUA_USE_POSIX
#endif
/*
@@ LUA_USE_POSIX includes all functionality listed as X/Open System
...
...
examples/lua/dirscan.lp
0 → 100644
View file @
74711c68
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
?>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment