| 33 | // *********************************************************************** |
| 34 | |
| 35 | int VfsStore(lua_State* L) { |
| 36 | u64 filenameLen; |
| 37 | const char* filename = luaL_checklstring(L, 1, &filenameLen); |
| 38 | |
| 39 | String realFileName; |
| 40 | if (!VFSPathToRealPath(String(filename), realFileName, g_pArenaFrame)) { |
| 41 | luaL_error(L, "Filepath not in a valid mount point", filename); |
| 42 | return 0; |
| 43 | } |
| 44 | |
| 45 | Serialize(L); |
| 46 | |
| 47 | // string is now on the stack |
| 48 | u64 contentLen; |
| 49 | const char* content = lua_tolstring(L, -1, &contentLen); |
| 50 | |
| 51 | WriteWholeFile(realFileName, content, contentLen); |
| 52 | return 0; |
| 53 | } |
| 54 | |
| 55 | // *********************************************************************** |
| 56 |
nothing calls this directly
no test coverage detected