Lister les informations sur le disque dur

Author:


{filelink=860}


import java.io.File;

public class VerificateurEspace {
  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("Espace libre = " + racines[i].getFreeSpace());
      System.out.println("Espace Utilisé = " + racines[i].getUsableSpace());
      System.out.println("Taille du disue = " + racines[i].getTotalSpace());
      System.out.println();
    }
  }
}

Leave a Reply

Your email address will not be published. Required fields are marked *