2022-08-09 19:23:21 +00:00
|
|
|
--- Loader for plain files
|
2022-09-19 10:58:27 +00:00
|
|
|
-- @module glass.readfile
|
2022-08-09 19:23:21 +00:00
|
|
|
|
|
|
|
--- Loads a normal file as a string.
|
|
|
|
-- @treturn string The content of the file
|
|
|
|
-- @function load
|
|
|
|
return function(path)
|
|
|
|
local f = io.open(path)
|
|
|
|
if not f then return end
|
|
|
|
local result = f:read("*a")
|
|
|
|
f:close()
|
|
|
|
return result
|
|
|
|
end
|