a guest Apr 6th, 2020 139 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- local component = require("component")
- local term = require("term")
- local floppy = component.drive
- local capacityInit = floppy.getCapacity()
- local capacity = capacityInit/1024
- local fileName = ""
- local dataToWrite = ""
- local offset = 1
- local file
- term.write("Floppy's capacity is ".. capacity .. " kilobytes")
- term.write("What file would you like to write to the floppy disk? File must be in the same folder as this program.")
- fileName = io.read()
- term.write(" ")
- term.write("Writing to Floppy...")
- file = io.open(fileName, "rb")
- dataToWrite = file:read(512)
- floppy.writeSector(offset, dataToWrite)
- offset = offset + 1
- until dataToWrite == nil
RAW Paste Data