#file #same #equal #inode

same-file

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

8 releases (4 stable)

1.0.3 Aug 25, 2018
1.0.2 Jan 10, 2018
1.0.1 Dec 30, 2017
1.0.0 Oct 21, 2017
0.1.2 Jan 14, 2017

#1 in Filesystem

Download history 14365/week @ 2018-06-03 16938/week @ 2018-06-10 15686/week @ 2018-06-17 16454/week @ 2018-06-24 21216/week @ 2018-07-01 17987/week @ 2018-07-08 20394/week @ 2018-07-15 20047/week @ 2018-07-22 19594/week @ 2018-07-29 20678/week @ 2018-08-05 19134/week @ 2018-08-12 18818/week @ 2018-08-19 19005/week @ 2018-08-26

80,104 downloads per month
Used in 728 crates (5 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

~508KB