Executable v0.1.0

Source
The path of the file the process is running.

CurrentExecutable

pub func CurrentExecutable(allocator: Allocator) -> PathBuffer ! IoError

The path of the executable file the process is running, as the system loaded it. Unlike Argument(0), which is whatever the parent chose to pass, this is the file itself, so a program that runs itself again or finds files installed beside it can rely on it. Windows, Linux and FreeBSD give an absolute path with symbolic links resolved; macOS gives the path the executable was loaded by, which may be relative to the directory the process started in or pass through links. Fails with NotFound when the system cannot say, as when Linux has no /proc mounted, and with LimitExceeded when the path cannot be stored.

Source

Parameters

NameTypeDescription
allocatorAllocatorwhat the path is kept in

Returns: the executable's path