Function std::os::self_exe_pathExperimental [-]  [+] [src]

pub fn self_exe_path() -> Option<Path>

Optionally returns the filesystem path to the current executable which is running.

Like self_exe_name() but without the binary's name.

Example

fn main() { use std::os; match os::self_exe_path() { Some(exe_path) => println!("Executable's Path is: {}", exe_path.display()), None => println!("Impossible to fetch the path of this executable.") }; }
use std::os;

match os::self_exe_path() {
    Some(exe_path) => println!("Executable's Path is: {}", exe_path.display()),
    None => println!("Impossible to fetch the path of this executable.")
};