1
What function do I use to read data from a file in Lua
?
For example:
lua_folder/
.... config.json
.... main.lua
I want to open this file config.json
through the Lua
.
1
What function do I use to read data from a file in Lua
?
For example:
lua_folder/
.... config.json
.... main.lua
I want to open this file config.json
through the Lua
.
2
Do a function to do it like this:
function file_getdata()
local data_file_path = gre.SCRIPT_ROOT .. "/myfile.json"
local f = io.open(data_file_path)
f = io.read("*all")
f = io.close()
return f
end
Browser other questions tagged lua
You are not signed in. Login or sign up in order to post.