** 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. */
| 199 | ** handle is in a consistent state. |
| 200 | */ |
| 201 | static LStream *newprefile (lua_State *L) { |
| 202 | LStream *p = (LStream *)lua_newuserdatauv(L, sizeof(LStream), 0); |
| 203 | p->closef = NULL; /* mark file handle as 'closed' */ |
| 204 | luaL_setmetatable(L, LUA_FILEHANDLE); |
| 205 | return p; |
| 206 | } |
| 207 | |
| 208 | |
| 209 | /* |
no test coverage detected