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

Function file_mode

atomic-repository/examples/materialize_bench.rs:129–139  ·  view source on GitHub ↗
(path: &Path)

Source from the content-addressed store, hash-verified

127}
128
129fn file_mode(path: &Path) -> Result<u32> {
130 #[cfg(unix)]
131 {
132 use std::os::unix::fs::PermissionsExt;
133 Ok(fs::metadata(path)?.permissions().mode() & 0o7777)
134 }
135 #[cfg(not(unix))]
136 {
137 Ok(u32::from(fs::metadata(path)?.permissions().readonly()))
138 }
139}
140
141fn record(repo: &Repository, message: &str, tick: &mut i64) -> Result<()> {
142 let mut header = ChangeHeader::new(message);

Callers 1

newMethod · 0.70

Calls 2

modeMethod · 0.45
permissionsMethod · 0.45

Tested by

no test coverage detected