(path: &Path, mode: u16)
| 961 | |
| 962 | #[cfg(unix)] |
| 963 | fn 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))] |
| 977 | fn set_mode(path: &Path, mode: u16) -> Result<(), SplitSnapshotError> { |
no test coverage detected