#file #equal #same #inode

same-file

A simple crate for determining whether two file paths point to the same file

10 releases (6 stable)

1.0.5 Jul 16, 2019
1.0.4 Oct 29, 2018
1.0.3 Aug 25, 2018
1.0.2 Jan 10, 2018
0.1.2 Jan 14, 2017

#7 in Filesystem

Download history 71780/week @ 2019-08-13 68613/week @ 2019-08-20 65508/week @ 2019-08-27 74222/week @ 2019-09-03 71036/week @ 2019-09-10 72991/week @ 2019-09-17 79563/week @ 2019-09-24 86922/week @ 2019-10-01 82606/week @ 2019-10-08 85596/week @ 2019-10-15 94082/week @ 2019-10-22 87336/week @ 2019-10-29 93453/week @ 2019-11-05 92752/week @ 2019-11-12 102786/week @ 2019-11-19

227,479 downloads per month
Used in 1,944 crates (12 directly)

Unlicense/MIT

29KB
430 lines

same-file

A safe and simple cross platform crate to determine whether two files or directories are the same.

Linux build status Windows build status

Dual-licensed under MIT or the UNLICENSE.

Documentation

https://docs.rs/same-file

Usage

Add this to your Cargo.toml:

[dependencies]
same-file = "1"

and this to your crate root:

extern crate same_file;

Example

The simplest use of this crate is to use the is_same_file function, which takes two file paths and returns true if and only if they refer to the same file:

extern crate same_file;

use same_file::is_same_file;

fn main() {
    assert!(is_same_file("/bin/sh", "/usr/bin/sh").unwrap());
}

Dependencies

~24KB