1 unstable release

0.2.1-dev May 20, 2023
0.2.0-dev May 20, 2023
0.1.0 Apr 29, 2023

#2320 in Development tools

MIT/Apache

23KB
257 lines

Fdups

Fdups is a Rust-based command-line tool and library for detecting duplicate files within a specified directory. It leverages the power and performance of Rust to quickly and efficiently find duplicate files, providing both a binary for direct use and a library for integration into other projects.

Features

  • Fast and efficient duplicate file detection
  • Supports recursive search through subdirectories
  • Provides a binary for direct usage
  • Offers a library for easy integration into other Rust projects
  • Cross-platform compatibility

Installation

To install Fdups, you need to have Rust installed on your system. If you don't have Rust, follow the instructions on the official Rust website.

Once you have Rust installed, clone this repository:

git clone https://github.com/ayushbindlish/fdups.git
cd fdups

Build and install the binary:

cargo build --release
cargo install --path .

Usage

Binary

To use the Fdups binary, run the following command:

fdups /path/to/directory

This will start the duplicate file search in the specified directory, including its subdirectories. The output will be a list of duplicate files grouped by their content.

Library

To use the Fdups library in your own Rust project, add it as a dependency in your Cargo.toml file:

[dependencies]
fdups = { git = "https://github.com/ayushbindlish/fdups.git" }

Then, in your Rust source code, import the fdups crate and use its find_duplicates function:

use fdups::find_duplicates;

fn main() {
    let path = "/path/to/directory";
    let duplicates = find_duplicates(path).unwrap();
    
    for (hash, files) in duplicates {
        println!("Duplicate files (hash: {}):", hash);
        for file in files {
            println!("\t- {}", file.display());
        }
    }
}

License

This project is licensed under the MIT OR Apache-2.0 License. See LICENSE-APACHE and LICENSE-MIT files for details.

Contributing

Contributions are welcome! Feel free to submit issues or pull requests, and we'll review them as soon as possible.

Dependencies

~8–17MB
~219K SLoC