MCPcopy Create free account
hub / github.com/Achain-Dev/Achain / newprefile

Function newprefile

src/Chain/libraries/glua/liolib.cpp:186–191  ·  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 ** handle is in a consistent state. */

Source from the content-addressed store, hash-verified

184** handle is in a consistent state.
185*/
186static LStream *newprefile(lua_State *L) {
187 LStream *p = (LStream *)lua_newuserdata(L, sizeof(LStream));
188 p->closef = nullptr; /* mark file handle as 'closed' */
189 luaL_setmetatable(L, LUA_FILEHANDLE);
190 return p;
191}
192
193
194/*

Callers 3

newfileFunction · 0.85
io_popenFunction · 0.85
createstdfileFunction · 0.85

Calls 2

lua_newuserdataFunction · 0.85
luaL_setmetatableFunction · 0.85

Tested by

no test coverage detected