Thread: Disk Information

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

    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?

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

  2. #2
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    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
    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!

    "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
    Two places:
    • /proc/ide
    • /sys/block

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

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