** this function has a separated environment, which defines the ** correct __close for 'popen' files */
| 172 | ** correct __close for 'popen' files |
| 173 | */ |
| 174 | static int io_popen (lua_State *L) { |
| 175 | const char *filename = luaL_checkstring(L, 1); |
| 176 | const char *mode = luaL_optstring(L, 2, "r"); |
| 177 | FILE **pf = newfile(L); |
| 178 | *pf = lua_popen(L, filename, mode); |
| 179 | return (*pf == NULL) ? pushresult(L, 0, filename) : 1; |
| 180 | } |
| 181 | |
| 182 | |
| 183 | static int io_tmpfile (lua_State *L) { |
nothing calls this directly
no test coverage detected