This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes How to access HD info like, size, free space..? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "How to access HD info like, size, free space..?" Watch "How to access HD info like, size, free space..?" New topic
Author

How to access HD info like, size, free space..?

Bruno Frascino
Ranch Hand

Joined: Jul 22, 2003
Posts: 55
Hi,
I would like to know if is possible to access HD info, like size, free space, and, wich package, or class from API I have to use for this!?
Thanks for any help!
Sorry about my english!


--BJCK--
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24057
    
  13

Java doesn't offer any access to this kind of information. You'd have to execute an external program, or use native methods.


[Jess in Action][AskingGoodQuestions]
Bruno Frascino
Ranch Hand

Joined: Jul 22, 2003
Posts: 55
Ok!
Thanks Ernest!
Bruno Frascino
Ranch Hand

Joined: Jul 22, 2003
Posts: 55
Hi,
About the last question... Why java cannot access this kind of information?!
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24057
    
  13

In general, Java doesn't have APIs to access things that are intrinsically platform-dependent. Some things that run Java don't have disks, for example, and different OS's treat even the seemingly basic notion of "free space" very differently.
Frankly, though, personally I think this is a weak excuse, and you could make a pretty good case as to why there should be an API for volume info like this.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: How to access HD info like, size, free space..?
 
Similar Threads
Heap, Data space and Prog space !
Hard Drive Free Space Size is incorrect
Free Web Space
Interacting with Windows API
what iPad apps do you use?