Biesterfeld: Getting Available Free Disk Space

Beitrag lesen

Hej,

is there any API-conform and platform-independend way
for getting the free disk space of a harddrive?

AFAIK not yet. Sure, you have the possibility to write your own native classes. Also you can try workarounds using Runtime.exec(). But neither Java SE 1.4.2 nor the Tiger provide options for your intention.

You'll have to wait for the Mustang-Release (aka Java SE 6.0), which will come up with Methods like File.getFreeSpace() or File.getTotalSpace().

Best
Biesterfeld

--
"Nein! ... Nein, schneller, leichter, verführerischer die dunkle Seite ist."