Skip to main content

Getting the free disk space

Posted by editor on June 3, 2005 at 7:46 PM PDT

IM's between me and Cooper a few weeks back:

Cooper: Stupid question nobody seems to know... Do you know how to find out the free space available on a filesystem from java?
Me: ah ha ha ha ha ha ha ha ha ha ha ha ha ha
Cooper: I take it you have seen that before?
Cooper: :-=
Me: I'm looking up the RFE for you
Me: suffice to say, for now, you're Runtime.exec()'ing a du and scraping stdin.
Cooper: Well, that will be a very cross platformy thing now won't it?
Me: ah ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha ha

Well, I guess I can take the "ha " out of my clipboard now, because the Sun bug-bot sent me an e-mail to say that Bug 4057701 (Need way to find free disk space) has been closed as fixed.

The bug report shows it as being fixed in mustang(b39), and thanks to the mustang project on java.net, you can check it out for yourself. And I literally mean you, because I'm on a Mac and thus can't build Mustang.

Still, it's a huge relief that after all this time, this embarrassing oversight/omission is finally being resolved. And by "finally", it's worth nothing that Thursday would have marked eight years to the day after the bug was filed.