Expand description
Copy a file between two filesystems without holding it in memory.
The source’s write_file_to runs on a scoped thread and feeds a bounded
channel of chunks; the consumer (usually the target’s create_file) reads
the other end. Peak memory is a few chunks, whatever the file’s size. A
producer error reaches the consumer as an io::Error rather than a short
read, so a failed source never yields a silently truncated copy.
Functions§
- with_
file_ reader - Run
consumeover a reader that streamsentry’s bytes out ofsource.