Results 1 to 4 of 4
  1. #1
    xmikul28 is offline Member
    Join Date
    Aug 2009
    Posts
    3
    Rep Power
    0

    Default Recognize HDD, CD/ROM, DVD/ROM drives

    Hello,
    I need help! I would like to recognize type of drives in java program.
    I have been looking for solution on the whole internet, but I found nothing.

    Can anybody help me?
    Thanx.

  2. #2
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    8

    Default

    If you mean distinguish between those types of file systems then the answer is that standard Java is not supposed to know about those things. The best you can do is
    Java Code:
    System.out.print(Arrays.toString(File.listRoots()));
    to get all the various roots you've got and manipulate them but Java won't tell you if one is your CD/ROM or your DVD/ROM.

  3. #3
    xmikul28 is offline Member
    Join Date
    Aug 2009
    Posts
    3
    Rep Power
    0

    Default

    At first thanx for reply.

    Code you have entered I know and I use it.
    I do not need to distinguish if one is CD/ROM or DVD/ROM, but almost the same, I need to distinguish if it is HHD or CD/ROM (DVD/ROM), removable disk, etc...

    Is this impossible too?

  4. #4
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    8

Similar Threads

  1. Setting path under Linux to recognize jre
    By cccccc in forum New To Java
    Replies: 4
    Last Post: 03-31-2009, 06:51 AM
  2. Using scanner.hasNext() but recognize return
    By ScKaSx in forum New To Java
    Replies: 5
    Last Post: 01-27-2009, 10:11 AM
  3. Listing Logical Drives
    By Juggler in forum New To Java
    Replies: 3
    Last Post: 08-10-2008, 07:08 AM
  4. Replies: 0
    Last Post: 07-30-2008, 11:25 AM
  5. Replies: 0
    Last Post: 01-20-2008, 06:07 AM

Posting Permissions

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