MCPcopy Create free account
hub / github.com/The-Powder-Toy/The-Powder-Toy / copy

Function copy

src/lua/LuaFileSystem.cpp:97–105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

95}
96
97static int copy(lua_State *L)
98{
99 GetLSI()->AssertInterfaceEvent();
100 auto filename = tpt_lua_checkByteString(L, 1);
101 auto newFilename = tpt_lua_checkByteString(L, 2);
102 std::vector<char> fileData;
103 lua_pushboolean(L, Platform::ReadFile(fileData, filename) && Platform::WriteFile(fileData, newFilename));
104 return 1;
105}
106
107void LuaFileSystem::Open(lua_State *L)
108{

Callers 13

XTickMethod · 0.85
ClearMethod · 0.85
InitFontDataFunction · 0.85
WriteAtMethod · 0.85
DumpMethod · 0.85
TransferMethod · 0.85
PartsClass · 0.85
FromSnapshotsMethod · 0.85
ForwardMethod · 0.85
RestoreMethod · 0.85
RestoreMethod · 0.85
brushFunction · 0.85

Calls 5

GetLSIFunction · 0.85
tpt_lua_checkByteStringFunction · 0.85
ReadFileFunction · 0.85
WriteFileFunction · 0.85
AssertInterfaceEventMethod · 0.80

Tested by

no test coverage detected