Solved

Directory list

Posted on 2002-05-24
2
186 Views
Last Modified: 2010-04-02
How can I get a list of files (and directorys) in a directory using standard C library functions? (Not Windows API functions)
Thanks,
Octi
0
Comment
Question by:octi
  • 2
2 Comments
 
LVL 30

Expert Comment

by:Axter
ID: 7032442
You can't do it using standard C library, because it's not part of the C/C++ standard.

You have to use OS specific or compiler specific functions.

The _findfile function is available in most compilers/OS.
0
 
LVL 30

Accepted Solution

by:
Axter earned 50 total points
ID: 7032461
Correction:

The _findfirst/_findnext functions are available in most compilers/OS.

Another set of commonly used functions are the opendir & readdir set.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now