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

pub fn self_exe_name() -> Option<Path>

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

Examples

fn main() { use std::os; match os::self_exe_name() { Some(exe_path) => println!("Path of this executable is: {}", exe_path.display()), None => println!("Unable to get the path of this executable!") }; }
use std::os;

match os::self_exe_name() {
    Some(exe_path) => println!("Path of this executable is: {}", exe_path.display()),
    None => println!("Unable to get the path of this executable!")
};