#permissions #directory #copy #directory-tree #recursion

cp_r

Copy files and directories recursively, preserving mtime and permissions

8 releases (4 breaking)

0.5.1 Mar 25, 2022
0.5.0 Feb 15, 2022
0.4.0 Dec 1, 2021
0.3.1 Nov 8, 2021
0.1.1 Oct 24, 2021

#1342 in Filesystem

Download history 122/week @ 2023-12-06 206/week @ 2023-12-13 168/week @ 2023-12-20 255/week @ 2023-12-27 213/week @ 2024-01-03 436/week @ 2024-01-10 167/week @ 2024-01-17 208/week @ 2024-01-24 194/week @ 2024-01-31 113/week @ 2024-02-07 110/week @ 2024-02-14 287/week @ 2024-02-21 238/week @ 2024-02-28 202/week @ 2024-03-06 144/week @ 2024-03-13 153/week @ 2024-03-20

776 downloads per month
Used in 2 crates

MIT license

20KB
229 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–8.5MB
~47K SLoC