2025-05-25 14:30:16 +07:00

13 lines
297 B
Lua

local files = {}
local open = io.open
function files.read_file(path)
local file = open(path, "rb") -- r read mode and b binary mode
if not file then return nil end
local content = file:read "*a" -- *a or *all reads the whole file
file:close()
return content
end
return files