[][src]Crate process_path

Executable & Dynamic Library Paths

Utility functions to get the path of the currently executing process or the the current dynamic library.

The latter is particularly useful for ‘plug-in’ type dynamic libraries that need to load resources stored relative to the location of the library in the file system.

Example

let path = process_path::get_executable_path();
match path {
    None => println!("The process path could not be determined"),
    Some(path) => println!("{:?}", path)
}

Supported Platforms

  • Linux
  • FreeBSD
  • NetBSD
  • DragonflyBSD
  • macOS
  • Windows

Functions

get_dylib_path

Gets the path of the current dynamic library. If the path cannot be determined, None is returned.

get_executable_path

Gets the path of the currently running process. If the path cannot be determined, None is returned.