13 lines
297 B
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 |