#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

#3 in Operating systems

Download history 6901/week @ 2018-10-11 6670/week @ 2018-10-18 6390/week @ 2018-10-25 6925/week @ 2018-11-01 7920/week @ 2018-11-08 7322/week @ 2018-11-15 6149/week @ 2018-11-22 8240/week @ 2018-11-29 8792/week @ 2018-12-06 8173/week @ 2018-12-13 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

30,238 downloads per month
Used in 488 crates (22 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

~795KB