Thread: Hard Drives & Directories

  1. #1
    Registered User
    Join Date
    Sep 2001
    Posts
    7

    Question Hard Drives & Directories

    Hi,

    I an using a Treeview (Borland Builder) to display all the files on the hard drive (windows explorer style).

    I am using FindFirst() to get the files and telling it to look in the C Drive, how can I confirm if the C drive is the root drive, also how can I look for D, E drives etc.

    I need a function to examine the make up of the hard drive.

    Can anyone help?


    Magic

  2. #2
    mustang benny bennyandthejets's Avatar
    Join Date
    Jul 2002
    Posts
    1,401
    how can I confirm if the C drive is the root drive
    Do you mean, confirm that windows is on C:\ ? That should be easy enough, just enumerate directories until you find a windows directory. I believe you can also call an API function to return the windows drive and path in a string.

    Just checked, the function is GetWindowsDirectory().

    I need a function to examine the make up of the hard drive
    I don't quite understand, could you elaborate? What aspect are you examining?
    [email protected]
    Microsoft Visual Studio .NET 2003 Enterprise Architect
    Windows XP Pro

    Code Tags
    Programming FAQ
    Tutorials

  3. #3
    Registered User
    Join Date
    Sep 2001
    Posts
    7
    Thanks, but how can I tell if a D or E partiton exists?

  4. #4
    Registered User
    Join Date
    Feb 2002
    Posts
    329
    By setting the FILE_ATTRIBUTE_DIRECTORY bit in the WIN32_FIND_DATA struct.
    Then you just scroll through the alphabet..
    If a drive is present, it will have a root dir:
    A:\
    B:\
    C:\
    etc..

  5. #5

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. I have a question about hard drives in Linux
    By Overworked_PhD in forum Tech Board
    Replies: 2
    Last Post: 12-29-2007, 10:29 AM
  2. Hard drives - capacity and speed
    By ulillillia in forum Tech Board
    Replies: 5
    Last Post: 06-01-2007, 09:55 AM
  3. dual master hard drives? can this be done?
    By xddxogm3 in forum Tech Board
    Replies: 5
    Last Post: 07-23-2004, 08:18 PM
  4. Api for getting hard drive's serial no.
    By cr_naik in forum Windows Programming
    Replies: 4
    Last Post: 06-30-2003, 03:07 PM
  5. installing hard drives and IDE cables...
    By dbaryl in forum Tech Board
    Replies: 14
    Last Post: 09-02-2002, 10:11 AM