To be able to rename files in editor scripts I wrote this horror of a function:
local function hacky_rename(old_path, new_path)
local old_file = io.open(old_path, "rb")
local old_data = old_file:read("*a")
io.close(old_file)
local new_file, err = io.open(new_path, "wb")
new_file:write(old_data)
io.close(new_file)
end
Example usage:
hacky_rename("./main/main.collection", "./main/not_main.collection")