mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-01 17:38:41 +00:00
Block access to the io
library
This commit is contained in:
parent
f8ad01ab7c
commit
2e3778ec0c
2 changed files with 13 additions and 34 deletions
|
@ -197,16 +197,17 @@ assert(table.indexof({"foo", "bar"}, "foo") == 1)
|
|||
assert(table.indexof({"foo", "bar"}, "baz") == -1)
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function file_exists(filename)
|
||||
local f = io.open(filename, "r")
|
||||
if f == nil then
|
||||
return false
|
||||
else
|
||||
f:close()
|
||||
return true
|
||||
if INIT ~= "client" then
|
||||
function file_exists(filename)
|
||||
local f = io.open(filename, "r")
|
||||
if f == nil then
|
||||
return false
|
||||
else
|
||||
f:close()
|
||||
return true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
function string:trim()
|
||||
return (self:gsub("^%s*(.-)%s*$", "%1"))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue