Skip to main content

fast_copy

Function fast_copy 

Source
pub fn fast_copy(src: &Path, dst: &Path) -> Result<u64>
Expand description

Copy src to dst, preserving sparseness. Returns the apparent size of the destination in bytes.

Tries reflink first (zero-copy COW); on filesystems without reflink support, walks the source’s allocation map and copies only its data extents into a ftruncate-established sparse destination.

Blocking. Callers in async contexts should wrap in tokio::task::spawn_blocking.