https://github.com/mirryi/cchmod
chmod calculator.
https://github.com/mirryi/cchmod
chmod
Last synced: about 1 year ago
JSON representation
chmod calculator.
- Host: GitHub
- URL: https://github.com/mirryi/cchmod
- Owner: mirryi
- License: mit
- Created: 2021-06-21T23:11:39.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2024-05-06T16:59:09.000Z (about 2 years ago)
- Last Synced: 2025-04-06T20:07:11.264Z (about 1 year ago)
- Topics: chmod
- Language: Rust
- Homepage:
- Size: 104 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/mirryi/cchmod/actions)
[](https://crates.io/crates/cchmod)
[](https://docs.rs/cchmod)
# cchmod
cchmod is a mode and permission calculator/converter for chmod.
## Install
Install via Cargo:
```bash
$ cargo install cchmod
```
## Usage
```bash
$ cchmod
cchmod
USAGE:
cchmod [FLAGS]
ARGS:
FLAGS:
-h, --help Prints help information
-n, --num Output the octal form
-s, --sym Output the symbolic form
-V, --version Prints version information
```
### Examples
Get the octal form of a mode:
```bash
$ cchmod -n rwxr-xr-x
755
```
Get the symbolic form of a mode:
```bash
$ cchmod -s 644
rw-r--r--
```
The same operations, on permission values:
```bash
$ cchmod -n r-x
5
$ cchmod -s 7
rwx
```
### Library
cchmod can be used as a library:
```rust
use cchmod::Mode;
let m = Mode::from_sym("rw-r--r--").unwrap();
println!("{}", m.as_num());
```
See the [docs](https://docs.rs/cchmod) for more information.