Powered by Ajaxy
Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset

Java: How to get the free space

Java: How to get the free space
{filelink=862}

import java.io.File;
public class DiskFreeSpace
 {
  public static void main(String[] args)
 {
    File[] racines = File.listRoots();
    for (int i = 0; i < racines.length; i++)
{
      System.out.println(racines[i]);
      System.out.println("Free space = " + racines[i].getFreeSpace());
      System.out.println();
    }
  }
}

No comments yet.

Leave a Comment