• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Free space in a drive

 
Rajib Sarma
Ranch Hand
Posts: 34
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
How can I obtain the amount of free space in a drive?
-Thanks
Rajib
 
Michael Ernest
High Plains Drifter
Sheriff
Posts: 7292
Netbeans IDE VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For which operating system?
 
Rajib Sarma
Ranch Hand
Posts: 34
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Michael,
For windows. Is there any platform independent way?
Thanks
-Rajib
 
Mark Herschberg
Sheriff
Posts: 6037
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
--Mark
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic