https://github.com/jondot/dircmp
📖 Compare two folders for the similarities and differences
https://github.com/jondot/dircmp
assert rust rust-lang testing
Last synced: about 1 year ago
JSON representation
📖 Compare two folders for the similarities and differences
- Host: GitHub
- URL: https://github.com/jondot/dircmp
- Owner: jondot
- License: apache-2.0
- Created: 2022-11-29T12:06:51.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-11-29T13:10:04.000Z (over 3 years ago)
- Last Synced: 2025-04-06T04:51:11.465Z (about 1 year ago)
- Topics: assert, rust, rust-lang, testing
- Language: Rust
- Homepage:
- Size: 14.6 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# dircmp
[
](https://github.com/jondot/dircmp)
[
](https://crates.io/crates/dircmp)
[
](https://docs.rs/dircmp)
[
](https://github.com/jondot/dircmp/actions?query=branch%3Amaster)
Compare two folders for the similarities and differences.
* Two way comparison
* File types (dir, symlink, etc.)
* Content difference is based on hashing the files, so binaries are also good for comparison
* Good for asserting in tests and for taking snapshot of difference or similarity
# Dependency
```toml
[dependencies]
dircmp = "0.1.0"
```
# Usage
Default usage:
```rust
let cmp = dircmp::Comparison::default();
let result = cmp
.compare(
Path::new("/tmp/a"),
Path::new("/tmp/b"),
)
```
Ignore components:
```rust
use regex::RegexSet;
let ignores = let set = RegexSet::new(&[
r"foo",
r"bar",
]).expect("should compile");
let cmp = dircmp::Comparison::new(ignores);
let result = cmp
.compare(
Path::new("/tmp/a"),
Path::new("/tmp/b"),
)
```
# Copyright
Copyright (c) 2022 [@jondot](http://twitter.com/jondot). See [LICENSE](LICENSE.txt) for further details.