pub fn current_exe() -> Result<PlatformPathBuf>
Expand description
Returns the full filesystem path of the current running executable as PlatformPathBuf
.
§Errors
Returns an Err
if unable to parse the path with the platform encoding.
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::current_exe()?;
println!("The current executable path is {}", path.display());
Ok(())
}