MCPcopy Create free account
hub / github.com/DFHack/dfhack / opencheck

Function opencheck

depends/lua/src/liolib.c:248–253  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

246
247
248static void opencheck (lua_State *L, const char *fname, const char *mode) {
249 LStream *p = newfile(L);
250 p->f = fopen(fname, mode);
251 if (p->f == NULL)
252 luaL_error(L, "cannot open file '%s' (%s)", fname, strerror(errno));
253}
254
255
256static int io_open (lua_State *L) {

Callers 2

g_iofileFunction · 0.85
io_linesFunction · 0.85

Calls 2

newfileFunction · 0.85
luaL_errorFunction · 0.85

Tested by

no test coverage detected