From b017526d711c91831107e9778c56b256ce4cba32 Mon Sep 17 00:00:00 2001 From: Marcos Kirsch Date: Sat, 18 Jul 2015 22:42:29 -0500 Subject: [PATCH] Show size, used, available space in file system --- http/file_list.lua | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/http/file_list.lua b/http/file_list.lua index 55c1389..1a7aa95 100644 --- a/http/file_list.lua +++ b/http/file_list.lua @@ -2,12 +2,20 @@ return function (connection, args) connection:send("HTTP/1.0 200 OK\r\nContent-Type: text/html\r\nCache-Control: private, no-store\r\n\r\n") connection:send('Server File Listing') connection:send('') + coroutine.yield() connection:send('

Server File Listing

') + + local remaining, used, total=file.fsinfo() + connection:send("Total size: " .. total .. " bytes
\n") + connection:send("In Use: " .. used .. " bytes
\n") + connection:send("Free: " .. remaining .. " bytes
\n") + + connection:send("

\n") + connection:send("Files:
\n") connection:send("

\n") + connection:send("

\n") connection:send('') end