filecache.lua

changeset 3
b2df1b3f2c83
child 7
038275cd92ed
equal deleted inserted replaced
2:3975fa5ed630 3:b2df1b3f2c83
1
2 module("filecache", package.seeall)
3
4 local cache={}
5
6 function get(file)
7 if not cache[file] then
8 local f=io.openX(file, "r")
9 cache[file]=f:read('*a')
10 f:close()
11 end
12 return cache[file]
13 end

mercurial