Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --lvl=1
- lookup="/*"
- empty=textutils.serialize({})
- contents={}
- current={}
- function tPrint(pTable)
- if type(pTable) ~= type({1,2}) then
- error("bad argument: table expected, got "..type(pTable))
- end
- for k,v in pairs(pTable) do
- print(v)
- sleep()
- end
- end
- while true do
- current = fs.find(lookup)
- if textutils.serialize(current) ~= empty then
- ---tPrint(current)
- if true then
- for k,v in pairs(current) do
- if not (#v>3) then
- if fs.isDir(v) then
- contents[v] = "Directory"
- else
- local bbb=fs.open(v,"r")
- contents[v] = bbb.readAll()
- bbb.close()
- end
- elseif string.sub(v,1,4) ~= "rom/" then
- if fs.isDir(v) then
- contents[v] = "Directory"
- else
- local bbb=fs.open(v,"r")
- contents[v] = bbb.readAll()
- bbb.close()
- end
- end
- end
- end
- current={}
- lookup=lookup.."/*"
- else
- break
- end
- end
- --print(textutils.serialize(contents))
- uu=fs.open("fileSystem","w")
- uu.writeLine("fileSystem = "..textutils.serialize(contents))
- uu.close()
Advertisement
Add Comment
Please, Sign In to add comment