Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local component = require("component")
- local tape = component.tape_drive
- local event = require("event")
- if tape.getSize()==0
- then
- print("Tape drive is empty!")
- os.exit(1)
- end
- size = tape.getSize()
- label = tape.getLabel()
- if label
- then
- print("Tape label: "..label.."\nSize "..size.." bytes.")
- else
- print("Tape label: N/A\nSize: "..size.." bytes.")
- end
- print("Don't forget to rewind tape befor format it!")
- print("WARNING, all your data will be deleted!")
- print("Formating process takes long. Proceed? Y/n")
- local _,_,key = event.pull("key_down")
- if key~=121 then os.exit(1) end
- x = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- for i=0,size/256
- do
- tape.write(x)
- tape.seek(256)
- print(i.."/"..size/256)
- end
- print("Tape "..label.." was formatted")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement