Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Directory list

Posted on 2002-05-24
2
Medium Priority
?
192 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 200 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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 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.

730 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