Solved

Directory list

Posted on 2002-05-24
2
190 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

623 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