** 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. */
| 186 | ** handle is in a consistent state. |
| 187 | */ |
| 188 | static LStream *newprefile (lua_State *L) { |
| 189 | LStream *p = (LStream *)lua_newuserdata(L, sizeof(LStream)); |
| 190 | p->closef = NULL; /* mark file handle as 'closed' */ |
| 191 | luaL_setmetatable(L, LUA_FILEHANDLE); |
| 192 | return p; |
| 193 | } |
| 194 | |
| 195 | |
| 196 | /* |
no test coverage detected