tree: 933d3ea18d1bf4da060c64b943e1dad8bbeb59b6 [path history] [tgz]
  1. examples/
  2. src/
  3. .cargo-checksum.json
  4. Cargo.toml
  5. COPYING
  6. LICENSE-MIT
  7. OWNERS
  8. README.md
  9. UNLICENSE
third_party/rust_crates/ask2patch/same-file/README.md

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());
}