Can I get disk size and its free space from a java program?
Can I get disk size and its free space from a java program?ThanksLook at java.lang.Runtime.
As per the Java doc,
- Returns the amount of free memory in the system. Calling the gc method may result in increasing the value returned by freeMemory
- Returns the total amount of memory in the Java Virtual Machine. The value returned by this method may vary over time, depending on the host environment.
hope that helps
Don't think so. To get hard drive info, you probably need to use System.exec. You can always take a look at java os projects (as any os should be able to return this info).