May-21-2018, 06:30 PM
Well, I've come back to this because, well, why not. I've decided to go the custom copy function route and have come up with this (very rough code--just proof of concept for myself):
@wavic - I'd love to see code examples. Helps me learn, for one. But in my testing (code is deleted at this point), built-in Python functions halt at the copy/move line until the transfer is complete. Proving me wrong is always welcome.
import shutil, os, sys with open('397.64-desktop.exe', 'rb') as f: with open('C:\\Users\Mark\Downloads\Ordenador\driver.exe', 'wb') as g: size = os.stat('397.64-desktop.exe').st_size while True: moving = f.read(1024576) g.write(moving) size2 = os.stat('C:\\Users\Mark\Downloads\Ordenador\driver.exe').st_size print('\r', size2 / size * 100)It works, but needs refinement (BIG time). I've noticed, however, that it is nowhere near as fast as shutil, or native OS copying. How can I improve the speed of transfers. I know of course you're limited to the IO of the drive but in my testing (NVME SSD) it's waaay slower than the drive can handle.
@wavic - I'd love to see code examples. Helps me learn, for one. But in my testing (code is deleted at this point), built-in Python functions halt at the copy/move line until the transfer is complete. Proving me wrong is always welcome.