MCPcopy Create free account
hub / github.com/Tencent/xLua / os_execute

Function os_execute

WebGLPlugins/loslib.c:141–154  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

139
140
141static int os_execute (lua_State *L) {
142#if defined(WINAPI_FAMILY_PARTITION)
143 return luaL_error(L, "unsupport api in uwp platform");
144#else
145 const char *cmd = luaL_optstring(L, 1, NULL);
146 int stat = system(cmd);
147 if (cmd != NULL)
148 return luaL_execresult(L, stat);
149 else {
150 lua_pushboolean(L, stat); /* true if there is a shell */
151 return 1;
152 }
153#endif
154}
155
156
157static int os_remove (lua_State *L) {

Callers

nothing calls this directly

Calls 3

luaL_errorFunction · 0.85
luaL_execresultFunction · 0.85
lua_pushbooleanFunction · 0.85

Tested by

no test coverage detected