Created
October 14, 2019 00:28
-
-
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.
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
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) |
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
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