From 8fcd841aa9af96c8a4a4d3c1a555d2d1ed42332c Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Sun, 19 Jul 2009 00:24:58 +0000 Subject: convert luci.fs users to nixio.fs api --- libs/uvl/luasrc/uvl.lua | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'libs/uvl/luasrc/uvl.lua') diff --git a/libs/uvl/luasrc/uvl.lua b/libs/uvl/luasrc/uvl.lua index dd8058f03..33f45bf89 100644 --- a/libs/uvl/luasrc/uvl.lua +++ b/libs/uvl/luasrc/uvl.lua @@ -19,7 +19,9 @@ $Id$ -- @class module -- @cstyle instance -local fs = require "luci.fs" +require "nixio.util" + +local fs = require "nixio.fs" local uci = require "luci.model.uci" local util = require "luci.util" local table = require "table" @@ -403,11 +405,11 @@ function UVL.read_scheme( self, shm, alias ) local bc = "%s/bytecode/%s.lua" %{ self.schemedir, shm } if not fs.access(bc) then - local files = fs.glob(self.schemedir .. '/*/' .. shm) + local files = nixio.util.consume(fs.glob(self.schemedir .. '/*/' .. shm)) - if files then + if #files > 0 then local ok, err - for i, file in ipairs( files ) do + for file in files do if not fs.access(file) then return false, so:error(ERR.SME_READ(so,file)) end -- cgit v1.2.3