Thread: File Navigation Interface?

  1. #1
    Registered User
    Join Date
    Jan 2006
    Posts
    11

    File Navigation Interface?

    I'm looking for a way to Browse the HDD, but I don't know how to read the contents of a directory. I'm sure there must be a function in the C library there somewhere, but so far I haven't been able to find a reference to it. Can somebody point me in the right direction?

    I'd prefer something that just reads the contents to an array or something, as opposed to displaying the text directly, since the interface will be drawn to video memory, as well as indicating which entries are files and which are directories to allow proper navigation.

    Cheers.

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661

  3. #3
    Registered User
    Join Date
    Jan 2006
    Posts
    11
    Ah. Damn, what a n00bish thing to overlook. I guess I wasn't expecting the FAQ to be that comprehensive. *shrugs* Well, thanks for that. Now I have a starting point.
    Last edited by Jimage; 02-12-2006 at 02:43 AM.

  4. #4
    Registered User
    Join Date
    Jan 2006
    Posts
    11
    Well that didn't help all that much. The win32 example won't compile in MinGW, and I'm not trying to search for a specific file within a directory anyway.

    What I'm aiming at is a window that contains a list of all the files and directories available in .\ (something like: [.] [..] [dir] [dir] file file ... file), with a selection cursor that can be moved around to select certain entries, jumping from one dir to another, or opening the specified file, when Enter is pressed.

    I went searching again and found some info on dirent.h, and worked out how I can list the contents of a directory. That's a start, but I also need to know how to determine which entries link to directories and which ones are files in order to make this thing work.

    GNU C seems to make it easy, with the d_type member in the directory structure, but that's not part of the library included in MinGW.

    Any ideas? Thankye muchly.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. A development process
    By Noir in forum C Programming
    Replies: 37
    Last Post: 07-10-2011, 10:39 PM
  2. Formatting the contents of a text file
    By dagorsul in forum C++ Programming
    Replies: 2
    Last Post: 04-29-2008, 12:36 PM
  3. C++ std routines
    By siavoshkc in forum C++ Programming
    Replies: 33
    Last Post: 07-28-2006, 12:13 AM
  4. file processing updating record error
    By uuser in forum C Programming
    Replies: 2
    Last Post: 04-27-2003, 12:13 AM
  5. Need a suggestion on a school project..
    By Screwz Luse in forum C Programming
    Replies: 5
    Last Post: 11-27-2001, 02:58 AM