#which #unix #command #which-rs

build which

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

11 releases (stable)

2.0.1 Nov 27, 2018
2.0.0 Mar 30, 2018
1.0.5 Feb 17, 2018
1.0.3 Oct 4, 2017
0.1.0 Oct 6, 2015

#5 in Operating systems

Download history 5929/week @ 2018-12-20 5291/week @ 2018-12-27 9201/week @ 2019-01-03 10857/week @ 2019-01-10 10979/week @ 2019-01-17 10807/week @ 2019-01-24 12106/week @ 2019-01-31 15347/week @ 2019-02-07 18760/week @ 2019-02-14 18456/week @ 2019-02-21 21009/week @ 2019-02-28 20474/week @ 2019-03-07 22493/week @ 2019-03-14 20949/week @ 2019-03-21 21691/week @ 2019-03-28

30,238 downloads per month
Used in 605 crates (28 directly)

MIT license

23KB
575 lines

Travis Build Status Appveyor Build status

which

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

Support platforms

  • Linux
  • Windows
  • macOS

Example

To find which rustc exectable binary is using. Locate installed execuable in cross platforms.

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

~1MB
~11K SLoC