This repository has been archived on 2025-06-08. You can view files and clone it, but cannot push or open issues or pull requests.
TaggedEngine/modules/files.lua

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