Advertisement
Guest User

read.lua

a guest
Apr 2nd, 2020
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.38 KB | None | 0 0
  1. local component = require("component")
  2. local tape = component.tape_drive
  3. local io = require("io")
  4.  
  5. print "type the adress of file (with name)"
  6. name = io.read()
  7. file = io.open(name, "a")
  8.  
  9. size = tape.getSize()
  10. tape.seek(-size)
  11. ost = size % 32
  12. size = (size - ost) / 32
  13.  
  14. a = 0
  15.  
  16. while a < size do
  17. temp = tape.read(32)
  18. io.write(temp)
  19. file:write(temp)
  20. a = a + 1
  21. end
  22.  
  23. file:close()
  24. print "Done!"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement