pub fn exe_path() -> io::Result<path::PathBuf> {
	#[cfg(any(target_os = "android", target_os = "linux"))]
	{
		Ok(path::PathBuf::from("/proc/self/exe"))
	}
	#[cfg(any(target_os = "dragonfly"))]
	{
		Ok(path::PathBuf::from("/proc/curproc/file"))
	}
	#[cfg(any(target_os = "netbsd"))]
	{
		Ok(path::PathBuf::from("/proc/curproc/exe"))
	}
	#[cfg(any(target_os = "solaris"))]
	{
		Ok(path::PathBuf::from(format!(
			"/proc/{}/path/a.out",
			nix::unistd::getpid()
		))) // or /proc/{}/object/a.out ?
	}
	#[cfg(not(any(
		target_os = "android",
		target_os = "dragonfly",
		target_os = "linux",
		target_os = "netbsd",
		target_os = "solaris"
	)))]
	{
		std::env::current_exe()
	}
}
/// Returns the path of the currently running executable. On Linux this is `/proc/self/exe`.
// https://stackoverflow.com/questions/1023306/finding-current-executables-path-without-proc-self-exe
Returns the path of the currently running executable. On Linux this is `/proc/self/exe`.
Returns the path of the currently running executable . On Linux this is ` / proc / self / exe ` .
pub fn exe_path() -> io::Result<path::PathBuf> {
	#[cfg(any(target_os = "android", target_os = "linux"))]
	{
		Ok(path::PathBuf::from("/proc/self/exe"))
	}
	#[cfg(any(target_os = "dragonfly"))]
	{
		Ok(path::PathBuf::from("/proc/curproc/file"))
	}
	#[cfg(any(target_os = "netbsd"))]
	{
		Ok(path::PathBuf::from("/proc/curproc/exe"))
	}
	#[cfg(any(target_os = "solaris"))]
	{
		Ok(path::PathBuf::from(format!(
			"/proc/{}/path/a.out",
			nix::unistd::getpid()
		))) // or /proc/{}/object/a.out ?
	}
	#[cfg(not(any(
		target_os = "android",
		target_os = "dragonfly",
		target_os = "linux",
		target_os = "netbsd",
		target_os = "solaris"
	)))]
	{
		std::env::current_exe()
	}
}
pub fn exe_path ( ) -> io :: Result < path :: PathBuf > { # [ cfg ( any ( target_os " " target_os " " ) ) ] { Ok ( path :: PathBuf :: from ( " " ) ) } # [ cfg ( any ( target_os " " ) ) ] { Ok ( path :: PathBuf :: from ( " " ) ) } # [ cfg ( any ( target_os " " ) ) ] { Ok ( path :: PathBuf :: from ( " " ) ) } # [ cfg ( any ( target_os " " ) ) ] { Ok ( path :: PathBuf :: from ( format ! ( " " nix unistd getpid ( ) ) ) ) // or /proc/{}/object/a.out ? } # [ cfg ( not ( any ( target_os " " target_os " " target_os " " target_os " " target_os " " ) ) ) ] { std :: env :: current_exe ( ) } }
Returns the path of the currently running executable.
Returns the path of the currently running executable .