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

Function set_mode

atomic-repository/src/repository/snapshot_split.rs:963–974  ·  view source on GitHub ↗
(path: &Path, mode: u16)

Source from the content-addressed store, hash-verified

961
962#[cfg(unix)]
963fn set_mode(path: &Path, mode: u16) -> Result<(), SplitSnapshotError> {
964 use std::os::unix::fs::PermissionsExt;
965 if !std::fs::symlink_metadata(path)
966 .map_err(RepositoryError::Io)?
967 .file_type()
968 .is_symlink()
969 {
970 std::fs::set_permissions(path, std::fs::Permissions::from_mode(mode as u32))
971 .map_err(RepositoryError::Io)?;
972 }
973 Ok(())
974}
975
976#[cfg(not(unix))]
977fn set_mode(path: &Path, mode: u16) -> Result<(), SplitSnapshotError> {

Callers 1

write_repository_entryFunction · 0.70

Calls 2

set_permissionsFunction · 0.85
permissionsMethod · 0.45

Tested by

no test coverage detected