fix linux get_info

This commit is contained in:
weisd
2024-11-03 09:48:55 +08:00
parent 16a81047e3
commit 4a9d44ec28
2 changed files with 2 additions and 6 deletions

View File

@@ -6,7 +6,7 @@ use std::path::Path;
use crate::{disk::Info, error::Result};
/// returns total and free bytes available in a directory, e.g. `/`.
pub fn get_info(p: impl AsRef<Path>, _first_time: bool) -> std::io::Result<Info> {
pub fn get_info(p: impl AsRef<Path>) -> std::io::Result<Info> {
let stat_fs = statfs(p.as_ref())?;
let bsize = stat_fs.block_size() as u64;

View File

@@ -43,7 +43,7 @@ fn get_fs_type(ftype: FsType) -> String {
}
}
pub fn get_info(path: &str, first_time: bool) -> Result<Info> {
pub fn get_info(path: &str) -> Result<Info> {
let statfs = statfs(path)?;
let reserved_blocks = statfs.blocks_free() - statfs.blocks_available();
let mut info = Info {
@@ -69,10 +69,6 @@ pub fn get_info(path: &str, first_time: bool) -> Result<Info> {
info.used = info.total - info.free;
if first_time {
// todo
}
Ok(info)
}