diff options
author | Ted Trask <ttrask01@yahoo.com> | 2015-12-30 13:50:12 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2015-12-30 13:53:11 +0000 |
commit | 37025219f0df09f2ebf1d4c62ff954deb84a14b3 (patch) | |
tree | b855f0c5d852debde4e4308dfb7a64f75bf83229 | |
parent | 2609c2a70d3f1dc75bc695c0421c5a54a523e961 (diff) | |
download | acf-asterisk-37025219f0df09f2ebf1d4c62ff954deb84a14b3.tar.bz2 acf-asterisk-37025219f0df09f2ebf1d4c62ff954deb84a14b3.tar.xz |
Change listfiles filesize to size, size and mtime not user-friendly, use posix.stat over fs.stat, use new format functions
-rw-r--r-- | asterisk-listfiles-html.lsp | 4 | ||||
-rw-r--r-- | asterisk-model.lua | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/asterisk-listfiles-html.lsp b/asterisk-listfiles-html.lsp index d4d1080..087ad56 100644 --- a/asterisk-listfiles-html.lsp +++ b/asterisk-listfiles-html.lsp @@ -44,8 +44,8 @@ end %> <tr> <td><% htmlviewfunctions.displayitem(cfe({type="link", value={filename=filename, redir=redir}, label="", option="Edit", action="edit"}), page_info, -1) %></td> <td><%= html.html_escape(file.filename) %></td> - <td><span class="hide"><%= html.html_escape(file.orig_size) %>b</span><%= html.html_escape(file.size) %></td> - <td><%= html.html_escape(file.mtime) %></td> + <td><span class="hide"><%= html.html_escape(file.size or 0) %>b</span><%= format.formatfilesize(file.size) %></td> + <td><%= format.formattime(file.mtime) %></td> </tr> <% end %> </tbody></table> diff --git a/asterisk-model.lua b/asterisk-model.lua index 6858e6f..6f37fe7 100644 --- a/asterisk-model.lua +++ b/asterisk-model.lua @@ -52,7 +52,7 @@ end mymodule.list_files = function() local retval = {} for file in fs.find(null, baseurl) do - local details = fs.stat(file) + local details = posix.stat(file) if details.type == "regular" then details.filename = file table.insert(retval, details) |