Skip to main content

stream_copy

Function stream_copy 

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

Copies a single file using buffered streaming I/O.

Reads and writes in STREAM_BUFFER_SIZE chunks. Memory usage is constant regardless of file size — a 1 KB file and a 1 GB file use the same buffer.

§Errors

Returns an error if the source cannot be read or the destination cannot be written.