Function dupcheck::duplicates_of [] [src]

pub fn duplicates_of(
    files: &[PathBuf],
    dirs_opt: Option<&[PathBuf]>
) -> Result<Vec<FileHash>>

Checks for duplicates of specified files.

If directories are specified, they will be checked; otherwise, a file's parent directory will be checked.

Errors

Returns an error if any files are not files, any paths within dirs_opt are not directories or if there are I/O errors while trying to read files or directories.

Examples

Check a file for duplicates within its parent directory:

use std::path::PathBuf;

let files = vec![PathBuf::from("foo.txt")];
let dup_result = dupcheck::duplicates_of(&files, None);

Check a file for duplicates within some other directory:

use std::path::PathBuf;

let files = vec![PathBuf::from("foo.txt")];
let dirs = vec![PathBuf::from("bar")];
let dup_result = dupcheck::duplicates_of(&files, Some(&dirs));