MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / newfile

Function newfile

third-party/lua-5.1.5/src/liolib.c:86–92  ·  view source on GitHub ↗

** When creating file handles, always creates a `closed' file handle ** before opening the actual file; so, if there is a memory error, the ** file is not left opened. */

Source from the content-addressed store, hash-verified

84** file is not left opened.
85*/
86static FILE **newfile (lua_State *L) {
87 FILE **pf = (FILE **)lua_newuserdata(L, sizeof(FILE *));
88 *pf = NULL; /* file handle is currently `closed' */
89 luaL_getmetatable(L, LUA_FILEHANDLE);
90 lua_setmetatable(L, -2);
91 return pf;
92}
93
94
95/*

Callers 6

io_openFunction · 0.70
io_popenFunction · 0.70
io_tmpfileFunction · 0.70
g_iofileFunction · 0.70
io_linesFunction · 0.70
createstdfileFunction · 0.70

Calls 2

lua_newuserdataFunction · 0.70
lua_setmetatableFunction · 0.70

Tested by

no test coverage detected