cap_primitives/fs/copy.rs
1use crate::fs::copy_impl;
2use std::path::Path;
3use std::{fs, io};
4
5/// Copies the contents of one file to another.
6#[inline]
7pub fn copy(
8 from_start: &fs::File,
9 from_path: &Path,
10 to_start: &fs::File,
11 to_path: &Path,
12) -> io::Result<u64> {
13 // In theory we could do extra sanity checks here, but `copy_impl`
14 // implementations use other sandboxed routines to open the files,
15 // so it'd be mostly redundant.
16 copy_impl(from_start, from_path, to_start, to_path)
17}