#recursion #permissions #directory #copy #directory-tree #walk-dir

cp_r

Copy files and directories recursively, preserving mtime and permissions

9 unstable releases

0.5.2 Oct 7, 2024
0.5.1 Mar 25, 2022
0.5.0 Feb 15, 2022
0.4.0 Dec 1, 2021
0.1.1 Oct 24, 2021

#313 in Filesystem

Download history 163/week @ 2024-10-21 13/week @ 2024-10-28 103/week @ 2024-11-04 166/week @ 2024-11-11 321/week @ 2024-11-18 141/week @ 2024-11-25 269/week @ 2024-12-02 345/week @ 2024-12-09 352/week @ 2024-12-16 251/week @ 2024-12-23 352/week @ 2024-12-30 312/week @ 2025-01-06 256/week @ 2025-01-13 275/week @ 2025-01-20 303/week @ 2025-01-27 414/week @ 2025-02-03

1,286 downloads per month
Used in 3 crates

MIT license

21KB
246 lines

Rust cp_r

https://github.com/sourcefrog/cp_r/

Docs Tests cargo-audit crates.io Maturity: Beta

A small Rust library to copy a directory tree preserving mtimes and permissions, with minimal dependencies, and with clean error reporting.

Features

  • Minimal dependencies: currently just filetime to support copying mtimes.
  • Returns a struct describing how much data and how many files were copied.
  • Tested on Linux, macOS and Windows.
  • Copies mtimes and permissions.
  • Takes an optional callback to decide which entries are copied or skipped, CopyOptions::filter.
  • Takes an optional callback to show progress or record which files are copied, CopyOptions::after_entry_copied.

See the docs for more information.

Patches welcome!

License: MIT.

Dependencies

~0–6.5MB
~34K SLoC