So, I am trying to copy files from old DVDs from a few decades ago, onto my laptop.
File Explorer was being a pain, and kept hanging randomly when it tried copying certain files.
and even worse, it only copied some of the files, leaving random gaps in my folder!
I didn't want to manually check all the filenames to see what to copy,
so I wrote a quick python script so that I would be able to copy the files faster without messing with File Explorer.
[Note: This script does not validate whether or not the files are equivalent, all it does is check the filenames.]
Something odd is happening. When my script copies .jpg or .mov files, occasionally, it will copy a file that is 2.45 GB!
What a specific number! I cannot open these JPGs, but now, I have dozens of 2.45 GB corrupted JPGs on my computer ๐ฑ whoops
I am guessing somehow, there's just no end of file to the jpgs or something, and it's somehow copying the entire disk in as if it were a jpg?
I am not sure! It's rather funny though ๐
Here is my script: https://paste.pythondiscord.com/BUCQ
(btw, I am new to the writing standards of python so if you have any feedback feel free to leave it too! happy to learn)
DVD Drive: Sandisk Ultra Slim Portable DVD Writer
Destination folder: D:/, m.2 2280 ssd
Is there something I can do to make my code safer and prevent it from attempting to copy files past a certain filesize limit?
Occasionally, the copying process will hang even in my script, and after 10 minutes, it will return
Problem copying IMG_7568.JPG: [Errno 13] Permission denied.
and the file will be copied partially like the attached image.
I would very much love to recover the photos that consistently corrupt like this, since they're baby photos!
Any help appreciated, thank you so much!