Results 1 to 4 of 4
  1. #1
    Juggler's Avatar
    Juggler is offline Member
    Join Date
    Jul 2008
    Location
    Chennai,India
    Posts
    16
    Rep Power
    0

    Default Listing Logical Drives

    Hai friends
    can anybody help me to list the avilable drives(logical Drives) and its name for Windows OS.......:):):)

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,562
    Rep Power
    25

    Default

    Look at File.listRoots()
    I don't know what you mean by:
    its name for Windows OS

  3. #3
    serjant's Avatar
    serjant is offline Senior Member
    Join Date
    Jun 2008
    Location
    Ukraine,Zaporozhye
    Posts
    487
    Rep Power
    7

    Default

    Java Code:
    System.out.println("Drive   Total   Free   Usable");
    System.out.println("------------------------------------------");
    for(File dir : File.listRoots){
            	System.out.println("%s %5d MB %5d MB%5dMB%n",dir,dir.getTotalSpace()/(1024*1024),dir.getFreeSpace()/(1024*1024),dir.getUsableSpace()/(1024*1024));
            	}

  4. #4
    Juggler's Avatar
    Juggler is offline Member
    Join Date
    Jul 2008
    Location
    Chennai,India
    Posts
    16
    Rep Power
    0

Similar Threads

  1. Listing all threads and threadgroups in the VM
    By Java Tip in forum java.lang
    Replies: 0
    Last Post: 04-09-2008, 06:36 PM
  2. Listing tables of a database
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 02-12-2008, 09:30 AM
  3. Replies: 0
    Last Post: 01-20-2008, 06:07 AM
  4. Listing subdirectories/files
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 01-13-2008, 07:19 AM
  5. Listing all available Locales
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 12-29-2007, 04:54 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •