use std::path::Path;
pub fn free_bytes(folder: &Path) -> Option<u64> {
#[cfg(any(target_os = "linux", target_os = "macos"))]
{
match rustix::fs::statvfs(folder) {
Ok(stats) => Some(stats.f_bavail.saturating_mul(stats.f_frsize)),
Err(_) => None,
}
}
#[cfg(not(any(target_os = "linux", target_os = "macos")))]
{
let _ = folder;
None
}
}