Skip to content

Instantly share code, notes, and snippets.

@iarp
Created October 14, 2019 00:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iarp/6c0266aa80bdc5a852c09dec49d8edc7 to your computer and use it in GitHub Desktop.
Save iarp/6c0266aa80bdc5a852c09dec49d8edc7 to your computer and use it in GitHub Desktop.
Mount, copy floppy, unmount. I needed to copy the contents of 100 floppies and used the following files. Insert floppy, ./copy.sh then eject when done.
import os
import shutil
floppy = '/home/linux/mounts/floppy/'
root = '/home/linux/mounts/family/Floppy_Disks/'
dirlen = len(os.listdir(floppy))
print(dirlen)
if not dirlen:
print('empty')
exit()
x = 0
while True:
x += 1
next_dir = os.path.join(root, str(x))
if not os.path.isdir(next_dir):
break
print(next_dir)
# os.mkdir(next_dir)
shutil.copytree(floppy, next_dir)
# os.rmdir(next_dir)
mount /dev/fd0 /home/linux/mounts/floppy
/usr/bin/python /home/linux/mounts/copy.py
umount /home/linux/mounts/floppy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment