Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Free Disk Space

Status
Not open for further replies.

mingus

Programmer
May 8, 2001
59
US
How do you get the amount of disk space free on a drive in Java?

thanks for any help

mingus
 
Maybee something like this will work

Runtime.getRuntime().exec("/bin/df -h");

where df = DiskFree
 
I thought of that, but was hoping for a Java method on the File Class or something. I dunno. Too many laguanges, some do this.

Since I really needed this for DB servers I found I can do EXEC master..xp_fixeddrives in SQL Server to get space. So I just to a JDBC connection to get the disk space. But I might have to the Runtime trick for my servers.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top