Disk Information

This is a discussion on Disk Information within the Linux Programming forums, part of the Platform Specific Boards category; Hi there, How do I enumerate through installed disks and retrieve information, such as: capacity, and whether it is a ...

  1. #1
    Code Monkey Davros's Avatar
    Join Date
    Jun 2002
    Posts
    812

    Disk Information

    Hi there,

    How do I enumerate through installed disks and retrieve information, such as: capacity, and whether it is a CD/DVD drive etc?

    There doesn't appear to be anything offering this functionality in the C or POSIX libraries. What can I use?

    Thanks
    Last edited by Davros; 06-24-2007 at 12:32 PM.
    OS: Windows XP
    Compilers: MinGW (Code::Blocks), BCB 5

    BigAngryDog.com

  2. #2
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    You could pipe 'fdisk -l' and parse it, but there's probably a better idea

  3. #3
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,893
    It seems the information you seek is hidden in the /sys directory, but how, I cannot tell. (There doesn't seem to be a very systematic way of finding something, much less of identifying it.)
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  4. #4
    Registered User
    Join Date
    Jun 2007
    Posts
    3
    Two places:
    • /proc/ide
    • /sys/block

  5. #5
    Code Monkey Davros's Avatar
    Join Date
    Jun 2002
    Posts
    812
    Thanks Guys!
    OS: Windows XP
    Compilers: MinGW (Code::Blocks), BCB 5

    BigAngryDog.com

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 5
    Last Post: 06-01-2009, 07:54 PM
  2. Going out of scope
    By nickname_changed in forum C++ Programming
    Replies: 9
    Last Post: 10-12-2003, 06:27 PM
  3. Formatting Output
    By Aakash Datt in forum C++ Programming
    Replies: 2
    Last Post: 05-16-2003, 08:20 PM
  4. Special Allegro Information
    By TechWins in forum Game Programming
    Replies: 12
    Last Post: 08-20-2002, 11:35 PM
  5. Information about disk
    By GaPe in forum C Programming
    Replies: 18
    Last Post: 08-05-2002, 06:48 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21