| 120 | // *********************************************************************** |
| 121 | |
| 122 | int VfsCopy(lua_State* L) { |
| 123 | u64 fromLen; |
| 124 | const char* from = luaL_checklstring(L, 1, &fromLen); |
| 125 | String realFrom; |
| 126 | if (!VFSPathToRealPath(String(from), realFrom, g_pArenaFrame)) { |
| 127 | luaL_error(L, "Filepath not in a valid mount point", from); |
| 128 | lua_pushboolean(L, false); |
| 129 | return 1; |
| 130 | } |
| 131 | |
| 132 | u64 toLen; |
| 133 | const char* to = luaL_checklstring(L, 2, &toLen); |
| 134 | String realTo; |
| 135 | if (!VFSPathToRealPath(String(to), realTo, g_pArenaFrame)) { |
| 136 | luaL_error(L, "Filepath not in a valid mount point", to); |
| 137 | lua_pushboolean(L, false); |
| 138 | return 1; |
| 139 | } |
| 140 | |
| 141 | |
| 142 | bool result = CopyFile(realFrom, realTo); |
| 143 | lua_pushboolean(L, result); |
| 144 | return 1; |
| 145 | } |
| 146 | |
| 147 | // *********************************************************************** |
| 148 |
nothing calls this directly
no test coverage detected