barista 0.16.8

Concurrent status bar with cache expirations and remote control; aggregating outputs from external collector processes.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use std::{path::Path, time::SystemTime};

use tokio::fs;

pub async fn size_in_bytes<P: AsRef<Path>>(path: P) -> anyhow::Result<u64> {
    let path = path.as_ref();
    let meta = fs::metadata(path).await?;
    let size = meta.len();
    Ok(size)
}

pub async fn mtime<P: AsRef<Path>>(path: P) -> anyhow::Result<SystemTime> {
    let path = path.as_ref();
    let meta = fs::metadata(path).await?;
    let mtime = meta.modified()?;
    Ok(mtime)
}