Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/spa5k/is_sudo
- Owner: spa5k
- Created: 2022-08-06T17:52:25.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-08-06T18:27:40.000Z (over 2 years ago)
- Last Synced: 2024-09-29T21:01:12.653Z (about 2 months ago)
- Topics: admin, linux, rust, rustlang, sudo, unix, windows
- Language: Rust
- Homepage: https://crates.io/crates/is_sudo
- Size: 5.86 KB
- Stars: 3
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
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"),
}
}
```