MCPcopy Create free account
hub / github.com/RomanKubiak/ctrlr / io_open

Function io_open

Source/Misc/lua/src/lua.c:12075–12081  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12073
12074
12075static int io_open (lua_State *L) {
12076const char *filename = luaL_checkstring(L, 1);
12077const char *mode = luaL_optstring(L, 2, "r");
12078FILE **pf = newfile(L);
12079*pf = fopen(filename, mode);
12080return (*pf == NULL) ? pushresult(L, 0, filename) : 1;
12081}
12082
12083
12084/*

Callers

nothing calls this directly

Calls 2

newfileFunction · 0.85
pushresultFunction · 0.85

Tested by

no test coverage detected