Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --DiskCopy by PeachMaster
- --There are comments for you BigJ :)
- term.clear()
- term.setCursorPos(1,1)
- print("DiskCopy by PeachMaster.")
- print("Left is input, right is output.")
- print("Press ENTER to start the operation.")
- read()
- local count = 1
- while true do
- sleep(5)
- if disk.isPresent("left") then -- Checks if a disk is present on the left disk drive.
- else -- It's not. Kay, error it..
- error("A disk is not in the left drive. Please check it.")
- end
- if disk.isPresent("right") then -- Checks again..
- else -- It's not. Kay, error it..
- error("A disk is not in the right drive. Please check it.")
- end
- print("Starting disk copy.")
- --Get every file and directory on the left disk.
- local FileList = fs.list(disk.getMountPath("left"))
- for i=1,FileList do
- fs.copy(table[i], disk.getMountPath("right"))
- end
- disk.setLabel("right", disk.getLabel("left"))
- --Disk copy completed!
- count = count + 1
- print(count.." copy created.")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement