From e7b9f25767decdd278d2e2aa2d9288a55e700f26 Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Wed, 30 Dec 2015 14:05:00 +0000 Subject: Change listfiles filesize to size, size and mtime not user-friendly, use posix.stat over fs.stat, use new format functions --- kamailio-listfiles-html.lsp | 4 ++-- kamailio-model.lua | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/kamailio-listfiles-html.lsp b/kamailio-listfiles-html.lsp index 8d16038..5b1c284 100644 --- a/kamailio-listfiles-html.lsp +++ b/kamailio-listfiles-html.lsp @@ -43,8 +43,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/kamailio-model.lua b/kamailio-model.lua index ce2fd72..96c15c4 100644 --- a/kamailio-model.lua +++ b/kamailio-model.lua @@ -163,7 +163,7 @@ end function mymodule.list_files() 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