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")
local l = file.list()
for name, size in pairs(l) do
-
local isHttpFile = string.match(name, "(http/)") ~= nil
local url = string.match(name, ".*/(.*)")
if isHttpFile then
@@ -15,8 +23,8 @@ return function (connection, args)
-- this list could be very long, so we'll yield in order to avoid overflowing the send buffer.
coroutine.yield()
end
-
end
connection:send("
\n")
+ connection:send("\n")
connection:send('')
end