G2A Many GEOs
SHARE
TWEET

umfloppy.lua

a guest Apr 6th, 2020 176 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local component = require("component")
  2. local term = require("term")
  3. local floppy = component.drive
  4. local fs = require("filesystem")
  5. local io = require("io")
  6.  
  7. local capacityInit = floppy.getCapacity()
  8. local capacity = capacityInit/1024
  9. local fileName = ""
  10. local dataToWrite = ""
  11. local offset = 0
  12. local file
  13.  
  14. term.clear()
  15. term.write("Floppy's capacity is "..  capacity .. " kilobytes")
  16. term.setCursor(1,2)
  17. term.write("What file would you like to write to the floppy disk? File must be in the same folder as this program.")
  18. term.setCursor(1,3)
  19. fileName = term.read()
  20. term.setCursor(1,3)
  21. term.write(" ")
  22. term.setCursor(1,3)
  23. term.write("Writing to Floppy...")
  24. file = io.open(fileName, r)
  25.  
  26. while (dataToWrite ~= nil) do
  27.   dataToWrite = file:read(offset)
  28.   floppy.writeByte(offset, dataToWrite)
  29.   offset = offset + 1
  30. end
RAW Paste Data
Ledger Nano X - The secure hardware wallet
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top