possum-db 0.2.2

concurrent disk-backed cache supporting efficient direct file I/O, transactions, and snapshots using file cloning and sparse files
Documentation
1
2
3
4
5
6
7
8
9
use std::path::Path;

pub(crate) use nix::errno::errno;

pub fn path_disk_allocation(path: &Path) -> std::io::Result<u64> {
    let metadata = std::fs::metadata(path)?;
    use std::os::unix::fs::MetadataExt;
    Ok(metadata.blocks() * 512)
}