Compare only permissions the current platform can observe. Windows' file metadata exposes a readonly bit, not POSIX executable/group/other bits.
(
expected_kind: InodeKind,
expected_mode: u16,
observed_kind: InodeKind,
observed_mode: u16,
)
| 85 | /// Compare only permissions the current platform can observe. Windows' file |
| 86 | /// metadata exposes a readonly bit, not POSIX executable/group/other bits. |
| 87 | pub fn inode_permissions_changed( |
| 88 | expected_kind: InodeKind, |
| 89 | expected_mode: u16, |
| 90 | observed_kind: InodeKind, |
| 91 | observed_mode: u16, |
| 92 | ) -> bool { |
| 93 | if !permission_bits_matter(expected_kind, observed_kind) { |
| 94 | return false; |
| 95 | } |
| 96 | if cfg!(windows) { |
| 97 | (expected_mode & 0o222 == 0) != (observed_mode & 0o222 == 0) |
| 98 | } else { |
| 99 | expected_mode != observed_mode |
| 100 | } |
| 101 | } |
| 102 | |
| 103 | impl InodeStatusFacts { |
| 104 | pub fn between( |