Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/spa5k/is_sudo

Checks whether the process is running as root/sudo/admin permission in Windows and Unix systems
https://github.com/spa5k/is_sudo

admin linux rust rustlang sudo unix windows

Last synced: about 1 month ago
JSON representation

Checks whether the process is running as root/sudo/admin permission in Windows and Unix systems

Awesome Lists containing this project

README

        

# Is_sudo

## Checks if program is running as sudo in unix systems, or using admin permission in windows.

## Usage

```rust
use is_sudo::check;
use is_sudo::RunningAs;

fn main() {
let running_as: RunningAs = is_sudo::check();

match running_as {
RunningAs::Root => println!("Running as root"),
RunningAs::User => println!("Running as user"),
}
}
```