Skip to main content

Module copy

Module copy 

Source
Expand description

The regular-file copy ladder: reflink (CoW clone) → kernel-side copy (fcopyfile on macOS, copy_file_range on Linux) → buffered fallback with page-aligned I/O buffers. Each strategy writes into the caller’s temporary path so the atomic-rename invariant is preserved.

Enums§

FsyncMode
When to fsync file data before the rename.
ReflinkMode
How aggressively to attempt reflink (copy-on-write) clones.

Functions§

copy_file_into
Copy src into the (not-yet-existing) tmp, returning bytes written.
copy_file_into_sized
Copy src into tmp using a caller-specified buffer size for the fallback path. All other behavior is identical to copy_file_into.