filecache.lua@458b3ce6e2f2
filecache.lua
Wed, 08 Dec 2021 23:32:16 +0200
- author
- Tuomo Valkonen <tuomov@iki.fi>
- date
- Wed, 08 Dec 2021 23:32:16 +0200
- changeset 40
- 458b3ce6e2f2
- parent 7
-
038275cd92ed
- permissions
- -rw-r--r--
highlight.js changes update
--@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