Crates.io | cchmod |
lib.rs | cchmod |
version | 0.1.3 |
source | src |
created_at | 2021-06-22 19:26:06.724771 |
updated_at | 2022-01-10 23:49:06.740871 |
description | chmod calculator. |
homepage | https://github.com/Dophin2009/cchmod |
repository | https://github.com/Dophin2009/cchmod.git |
max_upload_size | |
id | 413524 |
size | 43,881 |
cchmod is a mode and permission calculator/converter for chmod.
Install via Cargo:
$ cargo install cchmod
$ cchmod
cchmod
USAGE:
cchmod [FLAGS] <input>
ARGS:
<input>
FLAGS:
-h, --help Prints help information
-n, --num Output the octal form
-s, --sym Output the symbolic form
-V, --version Prints version information
Get the octal form of a mode:
$ cchmod -n rwxr-xr-x
755
Get the symbolic form of a mode:
$ cchmod -s 644
rw-r--r--
The same operations, on permission values:
$ cchmod -n r-x
5
$ cchmod -s 7
rwx
cchmod can be used as a library:
use cchmod::Mode;
let m = Mode::from_sym("rw-r--r--").unwrap();
println!("{}", m.as_num());
See the docs for more information.