Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Java and Drive Space

Posted on 2004-10-20
8
Medium Priority
?
226 Views
Last Modified: 2010-03-31
Is there anyway to find out the size of a disk and free space on the drive?

I have seen some examples of how to do this by creating temp files on the drive ( I though this was a bit bad )
Does anyone know if it can be done?

Thanks
0
Comment
Question by:ice_nin
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 37

Expert Comment

by:zzynx
ID: 12359602
You could execute a dir command (windows) and parse the output
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 12359604
You could

Runtime.getRuntime().exec.("cmd.exe /C dir");
0
 
LVL 24

Expert Comment

by:sciuriware
ID: 12360645
Restriction: an empty disk returns an error message so the parsing gets complex.
I wonder why getenv() finally is incorporated into JAVA 5 and something universal like this is not.
;JOOP!
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:ice_nin
ID: 12443491
is there not a universal way of checking, because my application is going to be run over several platforms ( not just windows )
0
 
LVL 37

Accepted Solution

by:
zzynx earned 500 total points
ID: 12443609
0
 
LVL 37

Expert Comment

by:zzynx
ID: 12443619
http://www.tolstoy.com/samizdat/jconfig.html
This indicates it IS possible (but maybe not that straightforward ;°)
0
 
LVL 37

Expert Comment

by:zzynx
ID: 12443784
:)
0
 

Author Comment

by:ice_nin
ID: 12443789
Thanks for all the help
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question