scp.py icon indicating copy to clipboard operation
scp.py copied to clipboard

Give enough information to the progress callback to display a progress bar

Open AdrienMatricon opened this issue 1 year ago • 3 comments

When downloading/uploading a single file, the progress and progress4 tell us how many bytes are involved in the transfer and how many were already transferred, so that works great and a progress bar can be displayed.

When downloading/uploading a directory, those callbacks tell us which file is being transferred and the individual progress of that file, but nothing of the overall transfer.

I don't know what's doable, but it would be nice to have a callback reporting the progress of the overall transfer, as in "3 of 10 files transferred" and "1857 bytes transferred of 656832 total"

AdrienMatricon avatar Oct 04 '24 09:10 AdrienMatricon

You should be able to compute that yourself. I am not sure it makes sense to build this into the client, though I would be open to adding a common recipe to the docs.

remram44 avatar Oct 04 '24 13:10 remram44

What do you mean? It's easy to compute how many files and bytes were received, but how do you know how many you are still expecting? I get that when sending a directory you can look up its contents ahead of time, but that's not really an option when receiving

AdrienMatricon avatar Oct 04 '24 15:10 AdrienMatricon

I don't think there is a way for this library to know that either.

remram44 avatar Oct 04 '24 16:10 remram44