AndreSoYeah

Untitled

Feb 21st, 2015
242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. --lvl=1
  2. lookup="/*"
  3. empty=textutils.serialize({})
  4. contents={}
  5. current={}
  6. function tPrint(pTable)
  7. if type(pTable) ~= type({1,2}) then
  8. error("bad argument: table expected, got "..type(pTable))
  9. end
  10. for k,v in pairs(pTable) do
  11. print(v)
  12. sleep()
  13. end
  14. end
  15. while true do
  16. current = fs.find(lookup)
  17. if textutils.serialize(current) ~= empty then
  18. ---tPrint(current)
  19. if true then
  20. for k,v in pairs(current) do
  21. if not (#v>3) then
  22. if fs.isDir(v) then
  23. contents[v] = "Directory"
  24. else
  25. local bbb=fs.open(v,"r")
  26. contents[v] = bbb.readAll()
  27. bbb.close()
  28. end
  29. elseif string.sub(v,1,4) ~= "rom/" then
  30. if fs.isDir(v) then
  31. contents[v] = "Directory"
  32. else
  33. local bbb=fs.open(v,"r")
  34. contents[v] = bbb.readAll()
  35. bbb.close()
  36. end
  37. end
  38. end
  39. end
  40. current={}
  41. lookup=lookup.."/*"
  42. else
  43. break
  44. end
  45. end
  46. --print(textutils.serialize(contents))
  47. uu=fs.open("finderTable","w")
  48. uu.writeLine("fileSystem = "..textutils.serialize(contents))
  49. uu.close()
Advertisement
Add Comment
Please, Sign In to add comment