From 37025219f0df09f2ebf1d4c62ff954deb84a14b3 Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Wed, 30 Dec 2015 13:50:12 +0000 Subject: Change listfiles filesize to size, size and mtime not user-friendly, use posix.stat over fs.stat, use new format functions --- asterisk-listfiles-html.lsp | 4 ++-- 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 %> <% htmlviewfunctions.displayitem(cfe({type="link", value={filename=filename, redir=redir}, label="", option="Edit", action="edit"}), page_info, -1) %> <%= html.html_escape(file.filename) %> - <%= html.html_escape(file.orig_size) %>b<%= html.html_escape(file.size) %> - <%= html.html_escape(file.mtime) %> + <%= html.html_escape(file.size or 0) %>b<%= format.formatfilesize(file.size) %> + <%= format.formattime(file.mtime) %> <% end %> 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) -- cgit v1.2.3