aspose file tools*
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 | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
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: 24187
    
  34

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: 24187
    
  34

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://aspose.com/file-tools
 
subject: How to access HD info like, size, free space..?