briannovius

file2table library

Jul 25th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. function readFile(path,table)
  2. local index = 1
  3. h = fs.open(path,"r")
  4. l = h.readLine()
  5. while (l ~= nil) do
  6. l = h.readLine()
  7. table[index] = l
  8. index = index + 1
  9. end
  10. h.close()
  11. h = fs.open(path,"r")
  12. table["content"] = h.readAll()
  13. h.close()
  14. end
  15. function loadFiles(table,...)
  16. for i=1,#arg do
  17. table[i] = {}
  18. file2table.readFile(arg[i],table[i])
  19. end
  20. end
Add Comment
Please, Sign In to add comment