/rust/registry/src/index.crates.io-1949cf8c6b5b557f/cap-primitives-3.4.5/src/fs/copy.rs
Line | Count | Source |
1 | | use crate::fs::copy_impl; |
2 | | use std::path::Path; |
3 | | use std::{fs, io}; |
4 | | |
5 | | /// Copies the contents of one file to another. |
6 | | #[inline] |
7 | 0 | pub fn copy( |
8 | 0 | from_start: &fs::File, |
9 | 0 | from_path: &Path, |
10 | 0 | to_start: &fs::File, |
11 | 0 | to_path: &Path, |
12 | 0 | ) -> 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 | 0 | copy_impl(from_start, from_path, to_start, to_path) |
17 | 0 | } |