comparison: filecache.lua
filecache.lua
- changeset 3
- b2df1b3f2c83
- child 7
- 038275cd92ed
equal
deleted
inserted
replaced
|
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 |