summaryrefslogtreecommitdiffstats
path: root/postfix-model.lua
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2015-06-29 09:43:28 -0400
committerTed Trask <ttrask01@yahoo.com>2015-06-29 09:43:28 -0400
commitb1712a70f888a4cf2f766a9c1d051274f9a2a81d (patch)
treef18813de6b7819c9f7b474ab429d6d7635ec8a37 /postfix-model.lua
parent737575acf425bafb18d30d82372b2df6a5872da3 (diff)
downloadacf-postfix-b1712a70f888a4cf2f766a9c1d051274f9a2a81d.tar.bz2
acf-postfix-b1712a70f888a4cf2f766a9c1d051274f9a2a81d.tar.xz
Modify listfiles to return full file details and drop non-existing files
Changes file.filesize to file.size
Diffstat (limited to 'postfix-model.lua')
-rw-r--r--postfix-model.lua7
1 files changed, 5 insertions, 2 deletions
diff --git a/postfix-model.lua b/postfix-model.lua
index 06436e5..1c71401 100644
--- a/postfix-model.lua
+++ b/postfix-model.lua
@@ -66,8 +66,11 @@ function mymodule.getfilelist()
local listed_files = {}
for i,name in ipairs(geteditablefilelist()) do
- local filedetails = fs.stat(name) or {}
- table.insert ( listed_files , {filename=name, mtime=filedetails.mtime or "---", filesize=filedetails.size or "0"} )
+ local filedetails = fs.stat(name)
+ if filedetails then
+ filedetails.filename = name
+ table.insert ( listed_files, filedetails )
+ end
end
table.sort(listed_files, function (a,b) return (a.filename < b.filename) end )