Skip to main content

utf8_current_exe

Function utf8_current_exe 

Source
pub fn utf8_current_exe() -> Result<Utf8PlatformPathBuf>
Expand description

Returns the full filesystem path of the current running executable as Utf8PlatformPathBuf.

§Errors

Returns an Err if unable to parse the path with the platform encoding or the path was not valid UTF8.

Additionally, returns a Err if, as env::current_exe states, a related filesystem operation or syscall fails.

§Examples

fn main() -> std::io::Result<()> {
    let path = typed_path::utils::utf8_current_exe()?;
    println!("The current executable path is {}", path);
    Ok(())
}