Guest User

Untitled

a guest
May 21st, 2015
280
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. local fs = require("filesystem")
  2. local term = require("term")
  3. local textsss
  4. local fileLength = 5
  5. if fs.exists("/data/usr/programs/wheee.txt") then
  6. term.write("file exists \n")
  7. else
  8. term.write("file does not exist you butt \n")
  9. end
  10. --Example
  11. file = fs.open("/data/usr/programs/wheee.txt",'a')--Arg 1 - file name / path Arg 2 option (r/w/a)
  12. file:write("Blah")
  13. file:close()
  14. file = fs.open("/data/usr/programs/wheee.txt", 'r')
  15. while textsss ~= nil do
  16. textsss = file:read("*l")
  17. term.write(tostring(textsss))
  18. end
  19. file:close()
Advertisement
Add Comment
Please, Sign In to add comment