Directory listing in VisualC?
Until recently I''ve been programming using Watcom C++ (11.0). There I could get access to various functions like: opendir, readdir, closedir etc, by including the direct.h header file. This file is also present in Visual C++ (6.0), but the opendir/readdir/closedir functions do not exist .... My problem is: How can I read a directory using a wild-card, when using Visual C++??? Thanks. .. .
-- Rasmus Neckelmann
There are Windows API calls that do the same thing. FindFirstFile is one such example. I think those functions will call the Windows API to do the actual work. The main reason for using the standard ones are for portability. I find it hard to believe they are not there. The ultimate source though is the help files. Look in the index under opendir and see what they say about it.
Keys to success: Ability, ambition and opportunity.
In short, use FindFirstFile, etc. like LilBudyWizer. I just want to add a couple of things.
As filesystems, and the general organization of files can be very different across different OS''s, there is no standard C set of functions which accomplish this task as LilBudyWizer hinted at.
Any function(s) you use will be platform/compiler dependent, so there really is no platform independent way of doing file/directory browsing, except for wrapping around specific API''s and hiding the platform dependency as much as possible.
--------------------------
I guess this is where most people put a famous quote...
"Everything is funnier with monkey''''s" - Unknown
As filesystems, and the general organization of files can be very different across different OS''s, there is no standard C set of functions which accomplish this task as LilBudyWizer hinted at.
Any function(s) you use will be platform/compiler dependent, so there really is no platform independent way of doing file/directory browsing, except for wrapping around specific API''s and hiding the platform dependency as much as possible.
--------------------------
I guess this is where most people put a famous quote...
"Everything is funnier with monkey''''s" - Unknown
--------------------------I guess this is where most people put a famous quote..."Everything is funnier with monkey''s" - Unknown
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement