https://github.com/sourcefrog/unix_mode
Print and manipulate unix mode bits / permissions (even on non-Unix)
https://github.com/sourcefrog/unix_mode
Last synced: 5 months ago
JSON representation
Print and manipulate unix mode bits / permissions (even on non-Unix)
- Host: GitHub
- URL: https://github.com/sourcefrog/unix_mode
- Owner: sourcefrog
- License: apache-2.0
- Created: 2020-05-07T23:50:42.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2025-06-20T21:08:56.000Z (8 months ago)
- Last Synced: 2025-08-16T10:38:25.433Z (6 months ago)
- Language: Rust
- Size: 42 KB
- Stars: 7
- Watchers: 2
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: NEWS.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# unix_mode: Decode, interpret, and display Unix file mode bits
[](https://crates.io/crates/unix_mode)
[](https://docs.rs/unix_mode)
[](https://github.com/sourcefrog/unix_mode/actions?query=workflow%3Arust)
`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 .
## License
Apache-2.0.
## Contributing
Patches are very welcome.
Please read the [contribution guidelines](CONTRIBUTING.md) and
[code of conduct](CODE_OF_CONDUCT.md).
## 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.