#file #same #equal #inode

same-file

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

9 releases (5 stable)

1.0.4 Oct 29, 2018
1.0.3 Aug 25, 2018
1.0.2 Jan 10, 2018
1.0.1 Dec 30, 2017
0.1.2 Jan 14, 2017

#1 in Filesystem

Download history 29721/week @ 2018-10-12 26164/week @ 2018-10-19 32296/week @ 2018-10-26 33096/week @ 2018-11-02 35628/week @ 2018-11-09 32366/week @ 2018-11-16 29975/week @ 2018-11-23 34782/week @ 2018-11-30 36672/week @ 2018-12-07 33752/week @ 2018-12-14 26124/week @ 2018-12-21 28958/week @ 2018-12-28 34348/week @ 2019-01-04 36150/week @ 2019-01-11 37303/week @ 2019-01-18

135,067 downloads per month
Used in 1,092 crates (6 directly)

Unlicense/MIT

26KB
366 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

~479KB