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

Function platform_symlink_mode

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

The POSIX mode a freshly created symlink carries on this platform. Linux `symlink(2)` ignores umask and always yields full permissions (`0o777`); macOS applies umask and typically yields `0o755`. Symlink permission bits are not settable through `std` on Linux (there is no `lchmod`), so leased effect plans must expect the platform's creation mode for `FileKind::Symlink` — never the inode's stored

()

Source from the content-addressed store, hash-verified

18/// mode for `FileKind::Symlink` — never the inode's stored mode, which
19/// records Git's kind (120000) semantics rather than physical bits.
20pub fn platform_symlink_mode() -> u16 {
21 #[cfg(target_os = "linux")]
22 {
23 0o777
24 }
25 #[cfg(not(target_os = "linux"))]
26 {
27 0o755
28 }
29}
30
31/// An unambiguous inode materialization plan.
32#[derive(Clone, Copy, Debug, PartialEq, Eq)]

Calls

no outgoing calls

Tested by

no test coverage detected