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