Skip to main content

copy_file

Function copy_file 

Source
pub fn copy_file<F>(
    source: &Path,
    target: &Path,
    on_progress: F,
) -> Result<CopyResult, CopyError>
where F: Fn(&CopyProgress),
Expand description

Copy a single file with progress callback.

Only copies if target doesn’t exist.

§Arguments

  • source - Source file path
  • target - Target file path
  • on_progress - Callback for progress updates

§Errors

  • If the copy operation fails