Skip to main content

find_on_path

Function find_on_path 

Source
pub fn find_on_path(binary: &str) -> Option<PathBuf>
Expand description

The first executable named binary on this process’s PATH, or None when there is none.

First match wins, which is the one execvp would run — the same rule [resolve_invoked_binary_path_in] reports under, so a caller naming a binary and a caller reporting one cannot disagree about which file PATH means. The path is returned as found, not canonicalized: callers here name a binary to a person rather than derive a grant from it.