valpackett / systemstat

Rust library for getting system information | also on https://codeberg.org/valpackett/systemstat
https://crates.io/crates/systemstat
The Unlicense
610 stars 71 forks source link

macOS purgeable space #91

Open fenhl opened 2 years ago

fenhl commented 2 years ago

macOS has a concept of purgeable space. It can be treated like free space for most purposes, because the OS deletes from it if space gets too low. As such, it would make sense to either include it in Filesystem.avail or add it as a separate API.

valpackett commented 2 years ago

would make sense to either include it in Filesystem.avail

No, on all unix platforms the free/avail/total fields directly correspond to the struct statfs fields and it should stay like that (I'll add some documentation comments).

add it as a separate API

I guess that would be fine, though we haven't had any platform-specific functions yet…

What is the API to retrieve it, btw?

fenhl commented 2 years ago

Good question. The third-party app DaisyDisk can detect it so it's definitely possible, and the “About This Mac” dialog shows it as available immediately so it doesn't require traversing the file hierarchy, but I haven't been able to find any info about how, and DaisyDisk is closed-source.