2023-10-17 09:18:07 +02:00
|
|
|
use core::fmt;
|
2023-10-22 13:16:42 +02:00
|
|
|
use std::{fs::Metadata, path::Path};
|
2023-10-12 04:09:54 +02:00
|
|
|
/// 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 {}
|
|
|
|
}
|