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

Function io_open

deps/lua/src/liolib.c:161–167  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

159
160
161static int io_open (lua_State *L) {
162 const char *filename = luaL_checkstring(L, 1);
163 const char *mode = luaL_optstring(L, 2, "r");
164 FILE **pf = newfile(L);
165 *pf = fopen(filename, mode);
166 return (*pf == NULL) ? pushresult(L, 0, filename) : 1;
167}
168
169
170/*

Callers

nothing calls this directly

Calls 2

newfileFunction · 0.85
pushresultFunction · 0.85

Tested by

no test coverage detected