filecache.lua@82d254b8f01e
filecache.lua
Wed, 31 Jan 2018 19:51:10 +0000
- author
- Tuomo Valkonen <tuomov@iki.fi>
- date
- Wed, 31 Jan 2018 19:51:10 +0000
- changeset 15
- 82d254b8f01e
- parent 7
-
038275cd92ed
- permissions
- -rw-r--r--
added markdown: true/false meta-tag
--@module filecache
local filecache={}
local cache={}
function filecache.get(file)
if not cache[file] then
local f=io.openX(file, "r")
cache[file]=f:read('*a')
f:close()
end
return cache[file]
end
return filecache