You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
local cjson = require("cjson.safe")
local cfg_file_path = './cfg.json'
local cfg_fd = io.open(cfg_file_path, 'r')
local cfg_contents = cfg_fd:read("*all")
local cfg_obj = cjson.decode(cfg_contents)
for key, value in pairs(cfg_obj) do
print(value)
end
the printout result:
192.168.1.100 10000.0
The text was updated successfully, but these errors were encountered:
environment: lua5.3 and lua-cjson 2.1.0.10-1
json file: cfg.json
lua code:
the printout result:
192.168.1.100
10000.0
The text was updated successfully, but these errors were encountered: