cristiammercado / node-disk-info

Node module to get disk information in Windows, Linux, Mac, FreeBSD & OpenBSD (works with Electron).
MIT License
58 stars 14 forks source link

Differing units between Windows and darwin #25

Open clovenski opened 2 years ago

clovenski commented 2 years ago

I took a look at how darwin is getting the disk info, and see that it uses df -P, which I believe outputs in counts of 512 bytes. Comparing this with what Windows is doing with wmic, I think Windows outputs in plain bytes. This should be properly documented if this is really the case.

For context, I've experienced false positives on darwin in a platform-agnostic app.

Ekristoffe commented 2 years ago

Interesting. I will check that this weekend. thanks for the report.

Ekristoffe commented 2 years ago

i just looked intoo it and you are right. This is also true for linux. Should we all base on 512 bytes like linux / darwin or in bytes like windows ?

clovenski commented 2 years ago

I feel basing in bytes like Windows feels more natural. As long as the unit is properly documented and honored on all platforms then either option is fine.