#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 23649/week @ 2018-09-18 26853/week @ 2018-09-25 28442/week @ 2018-10-02 31998/week @ 2018-10-09 29318/week @ 2018-10-16 25772/week @ 2018-10-23 30750/week @ 2018-10-30 34061/week @ 2018-11-06 34145/week @ 2018-11-13 32959/week @ 2018-11-20 31673/week @ 2018-11-27 32500/week @ 2018-12-04 34129/week @ 2018-12-11

80,104 downloads per month
Used in 895 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

~494KB