View Single Post
Old 12-09-2004, 07:14 AM   #5 (permalink)
redhead
Newbie
 
redhead's Avatar
 
Join Date: Jun 2002
Location: Denmark
Posts: 1,726
redhead is on a distinguished road
sounds to me, what he is looking for is a way of reading which files that are in a directory, only showing the user the ones with a specific type (ie. .doc, .exl, .txt, etc.) then the user can chose which of these files to open and read in.
something like [pseudocode]
Code:
struct dirent * curr_dir;
DIR* my_dir;
my_dir = opendir("some_dir");
while (curr_dir = readdir(my_dir))
{
       if(!my_ending(curr_dir.d_name))
          /* don't show user */
       else
          /* show user filename */
}
I know this is very system depending on the structures and opendir()/readdir() calls, thats why I've kept away from this untill now..
And as valmont points out, it is not strict C/C++ thus more apropriate in the Platform/API C++ section. besides the thing with a "user chose from list" sounds to me like a very GUI based solution, which is way beond what you'd expect in a strict C/C++ programming.
__________________
Don't worry Ma'am, We're university students, We know what We're doing.
-----
If you pull the pin, Mr.Grenade would no longer be your friend.
-----
01000111 01101111 00100000 01000011 00100000 00100001
redhead is offline   Reply With Quote