Created
June 13, 2017 03:52
-
-
Save advorak/bdc26d2e874cdc17e5d9bfd7e947df73 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'fileutils' | |
floppy_location = '/Volumes/floppy' | |
files = Dir['/tmp/Mac OS 8.1/*.img.*'] | |
files.each do |file| | |
puts "#{Time.now}:\t#{file}" | |
# Wait until floppy is mounted... | |
until File.exists?(floppy_location) do | |
sleep 1 | |
end | |
until File.stat(floppy_location).uid == 501 do | |
sleep 1 | |
end | |
# Delete old file off floppy | |
Dir["#{floppy_location}/*.img.*"].each do |filename| | |
puts "#{Time.now}" | |
FileUtils.rm filename | |
end | |
file = Dir['/tmp/Mac OS 8.1/*.img.*'].first | |
filesize = File.stat(file).size | |
FileUtils.mv file, floppy_location | |
until !File.exists?(file) | |
sleep 1 | |
end | |
until !File.exists?(floppy_location) do | |
`diskutil eject /dev/disk1` | |
sleep 1 | |
end | |
puts "#{Time.now}:\tDISK EJECTED!!!\n\n" | |
`say "disk ejected"` | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
repeat | |
with timeout of (60 * 30) seconds | |
tell application "Finder" | |
list disks | |
repeat until (list disks) contains "floppy" | |
end repeat | |
set newfiles to files of disk "floppy" | |
repeat with myfile in newfiles | |
duplicate myfile to ((((path to desktop folder) as string) & "Downloads:Mac OS 8.5") as alias) | |
(*((path to desktop folder) & "Downloads:Mac OS 8.5:")*) | |
if disk "floppy" exists then | |
eject | |
end if | |
end repeat | |
end tell | |
end timeout | |
end repeat |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment