filecache.lua

changeset 3
b2df1b3f2c83
child 7
038275cd92ed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filecache.lua	Sun Sep 13 22:22:47 2009 +0300
@@ -0,0 +1,13 @@
+
+module("filecache", package.seeall)
+
+local cache={}
+
+function 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

mercurial