Skip to content

0323pin/cchmod

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

75 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build status Crates.io Docs.rs

cchmod

cchmod is a mode and permission calculator/converter for chmod.

Install

Install via Cargo:

$ cargo install cchmod

Or, if you are on NetBSD, a pre-compiled binary is available from the official repositories. To install it, simply run:

# pkgin install cchmod

Usage

$ 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

Examples

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

Library

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.

About

chmod calculator.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 93.6%
  • Shell 3.4%
  • Roff 3.0%