Let's start with the basics of getting a list;
local list = fs.list(dir)
now to open that list in to a "tree" we could do:
local function makeTree(root, list)
local tree = {}
for i=1,#list do
local item = list[i]
if fs.isDir(item) then
tree[#tree + 1] = makeTree(root.."/"..item, fs.list(root.."/"..item))
else
tree[#tree + 1] = item
end
end
return tree
end
now to print that tree on to the screen you just do:
local function printTree(tree, tab)
for i=1,#tree do
local item = tree[i]
if type(item) == "string" then
print(tab..item)
else
printTree(item, tab.." ")
end
end
end
splitting that up in to pages would be a little bit harder, but for now I'll leave you with those and you can try and figure out the rest, keep asking if you don't understand what the code does or need help with certain bits, just don't ask for us to program an entire program for you.