Skip to content

Commit c2ce7f1

Browse files
committed
Add a couple of examples to the README
1 parent 0576707 commit c2ce7f1

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,13 @@ This library provides functions to decode and print Unix mode bits /
88
permissions, even on non-Unix platforms.
99

1010
On Unix, decoding is supported by `std::os::unix::fs` in the standard library,
11-
but this crate adds a function to print them in the format used by `ls -l`.
11+
but this crate adds a function to render them in the format used by `ls -l`,
12+
and to understand the file type and permissions.
13+
14+
assert_eq!(unix_mode::to_string(0o0040755), "drwxr-xr-x");
15+
assert_eq!(unix_mode::to_string(0o0100640), "-rw-r-----");
16+
17+
assert_eq!(unix_mode::is_symlink(0o0040755), false);
1218

1319
For API documentation see <https://docs.rs/unix_mode>.
1420

0 commit comments

Comments
 (0)