I am trying to copy files from one source machine(A) to destination machine(C), where the script that does this transfer is on a different machine (B).
I want to understand if shutil.copyfileobj is copying bits from A -> B -> C or doing a direct transfer from A -> C.
If shutil.copyfileobj is not doing a direct transfer are there any other package functions that can help achieve the implementation that I am looking for.
Example Code:
from pathlib import Path
import shutil
# Current path of the script
print(Path.getcwd())
# C://users/myname/
machine_a = Path("//NETWORK_DRIVE_1/foo")
machine_b = Path("//NETWORK_DRIVE_2/bar")
filename = "biz.txt"
shutil.copyfileobj(
src = machine_a.joinpath(filename),
dst = machine_b.joinpath(filename),
length = 2048 * 1024 # Chunk transfer
)