Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local tArg = {...}
- local fileName = tArg[1]
- local tapeName = tArg[2]
- local tape = peripheral.find("tape_drive")
- local file = fs.open(fs.combine(shell.dir(),fileName), "rb")
- local byte = 0
- tape.seek(-2^20)
- if tapeName then
- tape.setLabel(tapeName)
- end
- local counter = 0
- while true do
- byte = file.read()
- if not byte then break end
- counter = counter + 1
- tape.write(byte)
- if counter % 2048 == 0 then
- counter = 0
- os.queueEvent("yield")
- os.pullEvent("yield")
- write(".")
- end
- end
- tape.seek(-2^20)
- print("\nIt is written.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement