summaryrefslogtreecommitdiffstats
path: root/clamav-model.lua
diff options
context:
space:
mode:
Diffstat (limited to 'clamav-model.lua')
-rw-r--r--clamav-model.lua10
1 files changed, 5 insertions, 5 deletions
diff --git a/clamav-model.lua b/clamav-model.lua
index f5c3240..370c4b3 100644
--- a/clamav-model.lua
+++ b/clamav-model.lua
@@ -2,6 +2,7 @@ local mymodule = {}
-- Load libraries
modelfunctions = require("modelfunctions")
+posix = require("posix")
fs = require("acf.fs")
format = require("acf.format")
@@ -38,13 +39,12 @@ function mymodule.getfilelist()
local listed_files = {}
for i,name in ipairs(filelist) do
- local filedetails = fs.stat(name) or {}
- table.insert ( listed_files , {filename=name, mtime=filedetails.mtime or "---", filesize=filedetails.size or "0"} )
+ local filedetails = posix.stat(name) or {}
+ filedetails.filename = name
+ table.insert(listed_files, filedetails)
end
- table.sort(listed_files, function (a,b) return (a.filename < b.filename) end )
-
- return cfe({ type="list", value=listed_files, label="ClamAV File List" })
+ return cfe({ type="structure", value=listed_files, label="ClamAV File List" })
end
function mymodule.getfiledetails(self, clientdata)