Sat, 01 Nov 2014 23:34:21 +0000
Lua 5.2 compatibility hack
3 | 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 |