From b1712a70f888a4cf2f766a9c1d051274f9a2a81d Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Mon, 29 Jun 2015 09:43:28 -0400 Subject: Modify listfiles to return full file details and drop non-existing files Changes file.filesize to file.size --- postfix-listfiles-html.lsp | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) (limited to 'postfix-listfiles-html.lsp') diff --git a/postfix-listfiles-html.lsp b/postfix-listfiles-html.lsp index 2a5a0c4..d21b875 100644 --- a/postfix-listfiles-html.lsp +++ b/postfix-listfiles-html.lsp @@ -3,20 +3,6 @@ htmlviewfunctions = require("htmlviewfunctions") html = require("acf.html") %> -<% -function convertsize(size) - if string.find(size, "k$") then - return tonumber(string.match(size, "[%d.]*")) * 1024.0 - elseif string.find(size, "M$") then - return tonumber(string.match(size, "[%d.]*")) * 1024.0 * 1024.0 - elseif string.find(size, "G$") then - return tonumber(string.match(size, "[%d.]*")) + 1024.0 * 1024.0 * 1024.0 - else - return tonumber(string.match(size, "[%d.]*")) - end -end -%> - @@ -63,7 +49,7 @@ end %> <% end %> <%= html.html_escape(file.filename) %> - <%= convertsize(file.filesize) %>b<%= html.html_escape(file.filesize) %> + <%= html.html_escape(file.orig_size) %>b<%= html.html_escape(file.size) %> <%= html.html_escape(file.mtime) %> <% end %> -- cgit v1.2.3