Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

sourcefrog/unix_mode

Open more actions menu

unix_mode: Decode, interpret, and display Unix file mode bits

crates.io docs.rs Tests

unix_mode provides functions to decode, interpret, and display Unix mode bits and permissions, even on non-Unix platforms.

On Unix, decoding is supported by std::os::unix::fs in the standard library, but this crate adds a function to render them in the format used by ls -l, and to understand the file type and permissions.

assert_eq!(unix_mode::to_string(0o0040755), "drwxr-xr-x");
assert_eq!(unix_mode::to_string(0o0100640), "-rw-r-----");

assert_eq!(unix_mode::is_symlink(0o0040755), false);

For API documentation see https://docs.rs/unix_mode.

License

Apache-2.0.

Contributing

Patches are very welcome.

Please read the contribution guidelines and code of conduct.

Disclaimer

This is not an official Google project. It is not supported by Google, and Google specifically disclaims all warranties as to its quality, merchantability, or fitness for a particular purpose.

About

Print and manipulate unix mode bits / permissions (even on non-Unix)

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.