#which #unix #command #which-rs

which

A Rust equivalent of Unix command “which”. Locate installed executable in cross platforms.

11 releases (stable)

3.0.0 Sep 22, 2019
2.0.1 Nov 27, 2018
2.0.0 Mar 30, 2018
1.0.5 Feb 17, 2018
0.1.0 Oct 6, 2015

#3 in Operating systems

Download history 25584/week @ 2019-06-09 28620/week @ 2019-06-16 27146/week @ 2019-06-23 21856/week @ 2019-06-30 22760/week @ 2019-07-07 24500/week @ 2019-07-14 24956/week @ 2019-07-21 24836/week @ 2019-07-28 26435/week @ 2019-08-04 27136/week @ 2019-08-11 26636/week @ 2019-08-18 26346/week @ 2019-08-25 26538/week @ 2019-09-01 27796/week @ 2019-09-08 29067/week @ 2019-09-15

110,034 downloads per month
Used in 689 crates (37 directly)

MIT license

19KB
446 lines

Travis Build Status Appveyor Build status

which

A Rust equivalent of Unix command "which". Locate installed executable in cross platforms.

Support platforms

  • Linux
  • Windows
  • macOS

Example

To find which rustc exectable binary is using.

use which::which;

let result = which::which("rustc").unwrap();
assert_eq!(result, PathBuf::from("/usr/bin/rustc"));

Documentation

The documentation is available online.


lib.rs:

which

A Rust equivalent of Unix command which(1).

Example:

To find which rustc executable binary is using:

use which::which;

let result = which::which("rustc").unwrap();
assert_eq!(result, PathBuf::from("/usr/bin/rustc"));

Dependencies

~71KB