Mon, 14 Sep 2009 00:16:13 +0300
fixes
| 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 |