I want to print the number of bytes of all free space of a partition using File.getUsuableSpace() but it returns another value than the df command (in Linux) does.
It does not differ that much, but it differs in several megabytes.
What could be the case?
Is the file that your File instance represents on the same partition as the one you're running df on?
From the docs: "Returns the number of bytes available to this virtual machine on the partition named by this abstract pathname"
Emphasis is mine.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With