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