#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

#10 in Filesystem

Download history 27058/week @ 2018-12-20 27874/week @ 2018-12-27 35105/week @ 2019-01-03 34969/week @ 2019-01-10 37169/week @ 2019-01-17 35550/week @ 2019-01-24 38396/week @ 2019-01-31 42625/week @ 2019-02-07 41484/week @ 2019-02-14 43901/week @ 2019-02-21 44469/week @ 2019-02-28 45236/week @ 2019-03-07 42193/week @ 2019-03-14 39858/week @ 2019-03-21 44438/week @ 2019-03-28

135,067 downloads per month
Used in 1,277 crates (7 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

~480KB