Created
January 5, 2015 20:40
-
-
Save sapier/629f416758b4277ee822 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local retval, message = os.rename(mobf_world_path .. "/mobf_settings.conf.new", | |
mobf_world_path .. "/mobf_settings.conf") | |
if not retval then | |
minetest.log(LOGLEVEL_ERROR,"MOBF: failed to swap old conf file" .. | |
" to new one: " .. mobf_world_path .. "/mobf_settings.conf" .. | |
"(.new): ERR=" .. message) | |
if string.find(message, "File exists") then | |
minetest.log(LOGLEVEL_ERROR,"MOBF: OS doesn't seem to rename to existing filename copying old file to .bak") | |
os.rename(mobf_world_path .. "/mobf_settings.conf.new", | |
mobf_world_path .. "/mobf_settings.conf") | |
os.rename(mobf_world_path .. "/mobf_settings.conf", | |
mobf_world_path .. "/mobf_settings.conf.bak") | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment