Storage device stat from path

I'm looking for a quick way to get basic storage device stats (total size, free space) for the device corresponding to a filesystem path.

I found systemstat which is comprehensive, cross platform, but not quite what I'm looking for, so wonder if there are any other ways to tackle this.

Perhaps https://docs.rs/fs2/0.4.3/fs2/ ?

2 Likes

Looks perfect, thanks. Searching web, lib.rs etc is not great at finding Rust things IME. I did a lot of searching and still missed that.