diff options
author | Ted Trask <ttrask01@yahoo.com> | 2015-12-30 14:08:21 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2015-12-30 14:08:21 +0000 |
commit | b3f3ab92160e1f77ceb05d0ec60b2034a9ddfa7b (patch) | |
tree | f1c6b9c650cf05375e8c688d0b4bb8b1831f4e6c /samba-model.lua | |
parent | 34b319411e15c941f282396d7f3e1209b80fd4aa (diff) | |
download | acf-samba-b3f3ab92160e1f77ceb05d0ec60b2034a9ddfa7b.tar.bz2 acf-samba-b3f3ab92160e1f77ceb05d0ec60b2034a9ddfa7b.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 'samba-model.lua')
-rw-r--r-- | samba-model.lua | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/samba-model.lua b/samba-model.lua index 70ddb67..1e2cd70 100644 --- a/samba-model.lua +++ b/samba-model.lua @@ -117,12 +117,13 @@ end function mymodule.listconfigfiles() 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="Samba File List" }) + return cfe({ type="structure", value=listed_files, label="Samba File List" }) end function mymodule.getconfigfile(filename) |