Boost provides a basic_directory_iterator
which provides a C++ standard conforming input iterator which accesses the contents of a directory. If you can use Boost, then this is at least cross-platform code.
More Related Contents:
- Getting a FILE* from a std::fstream
- How do I rename a file with a string using the rename() function (c++)? [closed]
- Odd error: ‘FILE *’ differs in levels of indirection from ‘FILE’ [closed]
- How do I take values from text file and input into a 2D array? c++
- Fastest way to check if a file exists using standard C++/C++11,14,17/C?
- mmap() vs. reading blocks
- tellg() function give wrong size of file?
- Read Unicode UTF-8 file into wstring
- Create a directory if it doesn’t exist
- Elegant ways to count the frequency of words in a file
- How to embed a file into an executable?
- c++ Read from .csv file
- What is the most elegant way to read a text file with c++?
- What is the Fastest Method for High Performance Sequential File I/O in C++?
- C++ class header files organization
- checking for eof in string::getline
- c++ template and header files [duplicate]
- How to read a file into vector in C++?
- Reading and writing a std::vector into a file correctly
- How do I get the directory from a file’s full path?
- std::fstream buffering vs manual buffering (why 10x gain with manual buffering)?
- Open QFile for appending
- How to write a Float Mat to a file in OpenCV
- How to read huge file in c++
- What’s preferred pattern for reading lines from a file in C++?
- How to check if a file has been opened by another application in C++?
- C++: Where does the ofstream class save the files to?
- How to count lines of a file in C++?
- Reading files larger than 4GB using c++ stl
- Performance Difference Between C and C++ Style File IO