MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / inode_permissions_changed

Function inode_permissions_changed

atomic-core/src/output/attribute.rs:87–101  ·  view source on GitHub ↗

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,
)

Source from the content-addressed store, hash-verified

85/// Compare only permissions the current platform can observe. Windows' file
86/// metadata exposes a readonly bit, not POSIX executable/group/other bits.
87pub 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
103impl InodeStatusFacts {
104 pub fn between(

Calls 1

permission_bits_matterFunction · 0.85