mirror of
https://github.com/appgurueu/modlib.git
synced 2024-11-22 15:23:48 +01:00
write_binary: default to safe file write on MT
This commit is contained in:
parent
eb0c6b28d3
commit
9bfefb9283
2
file.lua
2
file.lua
@ -50,6 +50,8 @@ function write_binary(filename, new_content)
|
|||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
write_binary = minetest and minetest.safe_file_write or write_binary_unsafe
|
||||||
|
|
||||||
function ensure_content(filename, ensured_content)
|
function ensure_content(filename, ensured_content)
|
||||||
local content = read(filename)
|
local content = read(filename)
|
||||||
if content ~= ensured_content then
|
if content ~= ensured_content then
|
||||||
|
Loading…
Reference in New Issue
Block a user