MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / io_popen

Function io_popen

deps/lua/src/liolib.c:174–180  ·  view source on GitHub ↗

** this function has a separated environment, which defines the ** correct __close for 'popen' files */

Source from the content-addressed store, hash-verified

172** correct __close for 'popen' files
173*/
174static int io_popen (lua_State *L) {
175 const char *filename = luaL_checkstring(L, 1);
176 const char *mode = luaL_optstring(L, 2, "r");
177 FILE **pf = newfile(L);
178 *pf = lua_popen(L, filename, mode);
179 return (*pf == NULL) ? pushresult(L, 0, filename) : 1;
180}
181
182
183static int io_tmpfile (lua_State *L) {

Callers

nothing calls this directly

Calls 2

newfileFunction · 0.85
pushresultFunction · 0.85

Tested by

no test coverage detected