diff options
author | Ted Trask <ttrask01@yahoo.com> | 2015-12-30 14:05:47 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2015-12-30 14:05:47 +0000 |
commit | db70500c25e5162e36c88c6a78316ae8b8bc1c5d (patch) | |
tree | 3c6218129669034ca39bca5720fea92d9f70e3c3 /lighttpd-model.lua | |
parent | 9297525fc6d0ef49c7f3c0bb51feb0fc0e234838 (diff) | |
download | acf-lighttpd-db70500c25e5162e36c88c6a78316ae8b8bc1c5d.tar.bz2 acf-lighttpd-db70500c25e5162e36c88c6a78316ae8b8bc1c5d.tar.xz |
Change listfiles filesize to size, size and mtime not user-friendly, use posix.stat over fs.stat, use new format functions
Diffstat (limited to 'lighttpd-model.lua')
-rw-r--r-- | lighttpd-model.lua | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lighttpd-model.lua b/lighttpd-model.lua index 7dd43ad..ffb6068 100644 --- a/lighttpd-model.lua +++ b/lighttpd-model.lua @@ -73,13 +73,14 @@ 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="Lighttpd File List" }) + return cfe({ type="structure", value=listed_files, label="Lighttpd File List" }) end function mymodule.getfiledetails(filename) |