]> git.proxmox.com Git - cargo.git/blob - vendor/same-file-0.1.3/README.md
New upstream version 0.22.0
[cargo.git] / vendor / same-file-0.1.3 / README.md
1 same-file
2 =========
3 A safe and simple **cross platform** crate to determine whether two files or
4 directories are the same.
5
6 [![Linux build status](https://api.travis-ci.org/BurntSushi/same-file.png)](https://travis-ci.org/BurntSushi/same-file)
7 [![Windows build status](https://ci.appveyor.com/api/projects/status/github/BurntSushi/same-file?svg=true)](https://ci.appveyor.com/project/BurntSushi/same-file)
8 [![](http://meritbadge.herokuapp.com/same-file)](https://crates.io/crates/same-file)
9
10 Dual-licensed under MIT or the [UNLICENSE](http://unlicense.org).
11
12 ### Documentation
13
14 https://docs.rs/same-file
15
16 ### Usage
17
18 Add this to your `Cargo.toml`:
19
20 ```toml
21 [dependencies]
22 same-file = "0.1"
23 ```
24
25 and this to your crate root:
26
27 ```rust
28 extern crate same_file;
29 ```
30
31 ### Example
32
33 The simplest use of this crate is to use the `is_same_file` function, which
34 takes two file paths and returns true if and only if they refer to the same
35 file:
36
37 ```rust
38 extern crate same_file;
39
40 use same_file::is_same_file;
41
42 fn main() {
43 assert!(is_same_file("/bin/sh", "/usr/bin/sh").unwrap());
44 }
45 ```