#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Location
    Jakarta
    Posts
    8
    Rep Power
    0

    file structure in c


    do you know how to read file structure using C
    I want to read current directory file and folder
    I've read the help but found nothing
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Posts
    68
    Rep Power
    11
    This is operating system specific. In Windows/DOS you can use FindFirstFile, FindNextFile, and the like. On POSIX compliant systems you can use opendir, readdir, and closedir. Look up your documentation to see which of these you have.
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Location
    Jakarta
    Posts
    8
    Rep Power
    0
    I finally can solve my problem
    but there's another problem
    how can you detect drives in computer using C
    every computer has different drive letters.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2002
    Location
    NC, USA
    Posts
    364
    Rep Power
    12
    The C language hasn't a clue about your disk drives or drive letters. You need to look at your OS's API for dealing with things like that.
  8. #5
  9. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Location
    Jakarta
    Posts
    8
    Rep Power
    0
    I found the answer already
    I can use setdisk();
    doing a check from drive A to Z

IMN logo majestic logo threadwatch logo seochat tools logo