Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

A Rust library to get the path of the currently executing process

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
NotificationsYou must be signed in to change notification settings

talagrand/process_path

 
 

Repository files navigation

A Rust library to get the path of the currently executing process orthe the current dynamic library.

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

Usage

Add this to yourCargo.toml:

[dependencies]process_path ="0.1.4"

and this to your crate root:

use process_path;

Example

This program prints its path to stdout:

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

Supported Platforms

PlatformUnderlying APIget_executable_path()get_dylib_path()
Linuxreadlink(/proc/self/exe)dladdr()
FreeBSDsysctl(3) orreadlink(/proc/curproc/file)dladdr()
NetBSDreadlink(/proc/curproc/exe)dladdr()
DragonflyBSDreadlink(/proc/curproc/file)dladdr()
macOS_NSGetExecutablePath()dladdr()
WindowsGetModuleFileName()GetModuleHandleEx()

License

Copyright Wesley Wiser andprocess_path contributors.

Licensed under either of

at your option.

About

A Rust library to get the path of the currently executing process

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Rust100.0%

[8]ページ先頭

©2009-2025 Movatter.jp