hi,all:

        As we known , now hadoop can't run on windows because of the unix shell 
used by ant and DF utility used by DF.java ,I think the unix shell could be 
easyly replace with java code or ant script ,And in Java 6, I find the DF 
utility can be replace with getUsableSpace()and getTotalSpace() of 
java.io.File. Between the two, you can show how much space
each file system has available and has in total(See the code listed below). May 
be the DF class should made to more smart to support different OS and JDK .

---------------------------
public class Space{
  public static void main(String args[]){
    Console console=System.console();
    File roots[]=File.listRoots();
    for(File root : roots){
      console.printf("%s has %,d of %,d free%n", root.getPath(),
                     root.getUsableSpace(), root.getTotalSpace()
      );
    }
  }
}
---------------------------
ouput:
---------------------------
A:\ has 30,720 of 730,112 free
C:\ has 5,825,671,680 of 39,974,860,288 free
D:\ has 51,128,320 of 100,431,872 free
---------------------------

        

        youlq
[EMAIL PROTECTED]
          2006-12-28

Reply via email to