Skip to main content

copy_file

Function copy_file 

Source
pub fn copy_file(
    src: &Path,
    dst: &Path,
    mode: ReflinkMode,
) -> Result<CopyOutcome, WorktreeError>
Expand description

Copy a single file from src to dst respecting the given ReflinkMode.

  • Required: use CoW only; return ReflinkNotSupported if the FS doesn’t support it.
  • Preferred (default): try CoW, fall back to standard copy.
  • Disabled: always use standard copy.

Returns the CopyOutcome describing what actually happened.