This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
Ulf Dittmer wrote:Perhaps this: "total=used+free+unallocated" is not correct, because usable/free space and unallocated space are not mutually exlcusive.
I'm not getting your point, please explain little bit more. thanks
Joined: Mar 22, 2005
My point is that your assumption that "total=used+free+unallocated" may be incorrect. The javadocs do a bad job of explaining what the difference between "unused" and "unallocated" disk space might be; it's certainly not clear to me (and, I suspect, might vary between different file systems),
The API docs state the returned values are a hint and not a guarantee.
As Ulf has said the docs are not clear on what exactly these terms relate to but unallocated space on a physical hard drive is space which hasn't been allocated to a volume yet and if this is what getUnallocatedSpace() is returning then that is why it doesn't show up on the windows file properties dialog.