MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / io_popen

Function io_popen

lib/lua/src/liolib.c:291–300  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

289
290
291static int io_popen (lua_State *L) {
292 const char *filename = luaL_checkstring(L, 1);
293 const char *mode = luaL_optstring(L, 2, "r");
294 LStream *p = newprefile(L);
295 luaL_argcheck(L, l_checkmodep(mode), 2, "invalid mode");
296 errno = 0;
297 p->f = l_popen(L, filename, mode);
298 p->closef = &io_pclose;
299 return (p->f == NULL) ? luaL_fileresult(L, 0, filename) : 1;
300}
301
302
303static int io_tmpfile (lua_State *L) {

Callers

nothing calls this directly

Calls 2

newprefileFunction · 0.85
luaL_fileresultFunction · 0.85

Tested by

no test coverage detected