MCPcopy Create free account
hub / github.com/DavidColson/Polybox / VfsMove

Function VfsMove

source/virtual_filesystem.cpp:149–172  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

147// ***********************************************************************
148
149int VfsMove(lua_State* L) {
150 u64 fromLen;
151 const char* from = luaL_checklstring(L, 1, &fromLen);
152 String realFrom;
153 if (!VFSPathToRealPath(String(from), realFrom, g_pArenaFrame)) {
154 luaL_error(L, "Filepath not in a valid mount point", from);
155 lua_pushboolean(L, false);
156 return 1;
157 }
158
159 u64 toLen;
160 const char* to = luaL_checklstring(L, 2, &toLen);
161 String realTo;
162 if (!VFSPathToRealPath(String(to), realTo, g_pArenaFrame)) {
163 luaL_error(L, "Filepath not in a valid mount point", to);
164 lua_pushboolean(L, false);
165 return 1;
166 }
167
168
169 bool result = MoveFile(realFrom, realTo);
170 lua_pushboolean(L, result);
171 return 1;
172}
173// ***********************************************************************
174
175void BindFileSystem(lua_State* L) {

Callers

nothing calls this directly

Calls 2

VFSPathToRealPathFunction · 0.85
StringClass · 0.70

Tested by

no test coverage detected