File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes Free space in a drive Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Free space in a drive" Watch "Free space in a drive" New topic

Free space in a drive

Rajib Sarma
Ranch Hand

Joined: Apr 29, 2002
Posts: 34
How can I obtain the amount of free space in a drive?

*** Rajib Prasad Sarma ***<br />==========================
Michael Ernest
High Plains Drifter

Joined: Oct 25, 2000
Posts: 7292

For which operating system?

Make visible what, without you, might perhaps never have been seen.
- Robert Bresson
Rajib Sarma
Ranch Hand

Joined: Apr 29, 2002
Posts: 34
Hi Michael,
For windows. Is there any platform independent way?
Mark Herschberg

Joined: Dec 04, 2000
Posts: 6037
There is no platform dependent way that I know of (as of JDK 1.3, but I doubt they added any in JDK 1.4). You need to make some native JNI calls.
I agree. Here's the link:
subject: Free space in a drive
It's not a secret anymore!