Skip to content

Transfer Strategies

File transfer strategies.

Functions:

Name Description
get_available_transfer_modes

Detect which transfer modes are supported on the current OS.

fetch_transfer_strategy

Return the appropriate transfer strategy instance.

transfer_copy

Copy a file from source to destination.

transfer_copy_preserve

Copy a file from source to destination preserving metadata.

transfer_move

Move a file from source to destination.

transfer_symlink

Create a symlink from source to destination.

transfer_hardlink

Create a hardlink from source to destination.

get_available_transfer_modes() -> tuple[TransferMode, ...]

Detect which transfer modes are supported on the current OS.

fetch_transfer_strategy(mode: str) -> Callable[[PathLike, str], None]

Return the appropriate transfer strategy instance.

Falls back to SYMLINK if the requested mode is not available.

transfer_copy(src: PathLike, dst: str) -> None

Copy a file from source to destination.

transfer_copy_preserve(src: PathLike, dst: str) -> None

Copy a file from source to destination preserving metadata.

transfer_move(src: PathLike, dst: str) -> None

Move a file from source to destination.

Create a symlink from source to destination.

Create a hardlink from source to destination.

Falls back to symlink if hardlinking across filesystems fails.