kanidm/libs/file_permissions/src/windows.rs
Firstyear afe9d28754
20231019 1122 account policy basics (#2245)
---------

Co-authored-by: James Hodgkinson <james@terminaloutcomes.com>
2023-10-22 11:16:42 +00:00

24 lines
634 B
Rust

use core::fmt;
use std::{fs::Metadata, path::Path};
/// Check a given file's metadata is read-only for the current user (true = read-only) Stub function if you're building for windows!
pub fn readonly(meta: &Metadata) -> bool {
eprintln!(
"Windows target asked to check metadata on {:?} returning false",
meta
);
false
}
#[derive(Debug)]
pub struct Diagnosis;
impl fmt::Display for Diagnosis {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
writeln!(f, "Unable to diagnose path issues on windows 😢")
}
}
pub fn diagnose_path(path: &Path) -> Diagnosis {
Diagnosis {}
}