Solved

Directory list

Posted on 2002-05-24
2
183 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
Comment Utility
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
Comment Utility
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

762 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

6 Experts available now in Live!

Get 1:1 Help Now