diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2009-07-19 00:24:58 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2009-07-19 00:24:58 +0000 |
commit | 8fcd841aa9af96c8a4a4d3c1a555d2d1ed42332c (patch) | |
tree | cf6466b373236442e63742cb4f73b22579940784 /libs/web/luasrc/template.lua | |
parent | 6abba6163290b58cd9ebae98d8459ac38ef52a4b (diff) |
convert luci.fs users to nixio.fs api
Diffstat (limited to 'libs/web/luasrc/template.lua')
-rw-r--r-- | libs/web/luasrc/template.lua | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libs/web/luasrc/template.lua b/libs/web/luasrc/template.lua index c8f4daa2dd..e8f65e3bec 100644 --- a/libs/web/luasrc/template.lua +++ b/libs/web/luasrc/template.lua @@ -24,7 +24,7 @@ limitations under the License. ]]-- -local fs = require "luci.fs" +local fs = require "nixio.fs" local sys = require "luci.sys" local util = require "luci.util" local table = require "table" @@ -173,18 +173,18 @@ function Template.__init__(self, name) local err if compiler_mode == "file" then - local tplmt = fs.mtime(sourcefile) or fs.mtime(sourcefile .. ".htm") - local commt = fs.mtime(compiledfile) + local tplmt = fs.stat(sourcefile, "mtime") or fs.stat(sourcefile .. ".htm", "mtime") + local commt = fs.stat(compiledfile, "mtime") if not fs.mtime(cdir) then - fs.mkdir(cdir, true) + fs.mkdirr(cdir) fs.chmod(fs.dirname(cdir), 777) end assert(tplmt or commt, "No such template: " .. name) -- Build if there is no compiled file or if compiled file is outdated - if not commt or (commt and tplmt and commt < tplmt) then + if not commt or (commt and tplmt and commt < tplmt) then local source source, err = fs.readfile(sourcefile) or fs.readfile(sourcefile .. ".htm") |