| 1 | # Rust `cp_r` |
| 2 | |
| 3 | <https://github.com/sourcefrog/cp_r/> |
| 4 | |
| 5 | [](https://docs.rs/cp_r) |
| 6 | [](https://github.com/sourcefrog/cp_r/actions?query=workflow%3ATests) |
| 7 | [](https://github.com/sourcefrog/cp_r/actions/workflows/cargo-audit.yml) |
| 8 | [](https://crates.io/crates/cp_r) |
| 9 |  |
| 10 | |
| 11 | A small Rust library to copy a directory tree preserving mtimes and |
| 12 | permissions, with minimal dependencies, and with clean error reporting. |
| 13 | |
| 14 | ## Features |
| 15 | |
| 16 | * Minimal dependencies: currently just `filetime` to support copying mtimes. |
| 17 | * Returns a struct describing how much data and how many files were copied. |
| 18 | * Tested on Linux, macOS and Windows. |
| 19 | * Copies mtimes and permissions. |
| 20 | * Takes an optional callback to decide which entries are copied or skipped, |
| 21 | `CopyOptions::filter`. |
| 22 | * Takes an optional callback to show progress or record which files are copied, |
| 23 | `CopyOptions::after_entry_copied`. |
| 24 | |
| 25 | See the [docs](https://docs.rs/cp_r) for more information. |
| 26 | |
| 27 | Patches welcome! |
| 28 | |
| 29 | License: MIT. |